diff --git a/CHANGELOG.md b/CHANGELOG.md index 593948d0..b78a4eb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,16 @@ ## [Unreleased](https://github.com/bunq/sdk_php/tree/HEAD) -[Full Changelog](https://github.com/bunq/sdk_php/compare/1.13.1...HEAD) +[Full Changelog](https://github.com/bunq/sdk_php/compare/1.14.0...HEAD) + +**Fixed bugs:** + +- AttachmentMonetaryAccount needs a monetaryAccountId parameter [\#185](https://github.com/bunq/sdk_php/issues/185) +- Incorrect name space for BunqException [\#166](https://github.com/bunq/sdk_php/issues/166) + +## [1.14.0](https://github.com/bunq/sdk_php/tree/1.14.0) (2020-07-27) + +[Full Changelog](https://github.com/bunq/sdk_php/compare/1.13.1...1.14.0) **Closed issues:** @@ -376,7 +385,6 @@ **Merged pull requests:** - Fixes \#36 on php5.6 [\#37](https://github.com/bunq/sdk_php/pull/37) ([OGKevin](https://github.com/OGKevin)) -- Added an .gitattributes file. [\#20](https://github.com/bunq/sdk_php/pull/20) ([cafferata](https://github.com/cafferata)) ## [0.9.1](https://github.com/bunq/sdk_php/tree/0.9.1) (2017-08-07) @@ -412,6 +420,7 @@ - \#28 remove phpstan as it does not support php 5.6 [\#29](https://github.com/bunq/sdk_php/pull/29) ([qurben](https://github.com/qurben)) - \#25 Update directory for composer scripts, also omit version. [\#26](https://github.com/bunq/sdk_php/pull/26) ([qurben](https://github.com/qurben)) - Updated composer.lock [\#23](https://github.com/bunq/sdk_php/pull/23) ([cafferata](https://github.com/cafferata)) +- Added an .gitattributes file. [\#20](https://github.com/bunq/sdk_php/pull/20) ([cafferata](https://github.com/cafferata)) - Fixed signature newline handling \(Windows\) [\#9](https://github.com/bunq/sdk_php/pull/9) ([BabyDino](https://github.com/BabyDino)) diff --git a/src/Http/ApiClient.php b/src/Http/ApiClient.php index 0278f77f..66c2aa67 100644 --- a/src/Http/ApiClient.php +++ b/src/Http/ApiClient.php @@ -86,7 +86,7 @@ class ApiClient /** * User agent constants. */ - const HEADER_USER_AGENT_BUNQ_SDK_DEFAULT = 'bunq-sdk-php/1.14.0'; + const HEADER_USER_AGENT_BUNQ_SDK_DEFAULT = 'bunq-sdk-php/1.14.1'; /** * Binary request constants. diff --git a/src/Model/Generated/Endpoint/AttachmentMonetaryAccount.php b/src/Model/Generated/Endpoint/AttachmentMonetaryAccount.php index e08d8f71..4aa33cc1 100644 --- a/src/Model/Generated/Endpoint/AttachmentMonetaryAccount.php +++ b/src/Model/Generated/Endpoint/AttachmentMonetaryAccount.php @@ -48,12 +48,16 @@ class AttachmentMonetaryAccount extends BunqModel * attachment using the X-Bunq-Attachment-Description header. * * @param string $requestBytes + * @param int|null $monetaryAccountId * @param string[] $customHeaders * * @return BunqResponseInt */ - public static function create(string $requestBytes, array $customHeaders = []): BunqResponseInt - { + public static function create( + string $requestBytes, + int $monetaryAccountId = null, + array $customHeaders = [] + ): BunqResponseInt { $apiClient = new ApiClient(static::getApiContext()); $apiClient->enableBinary(); $responseRaw = $apiClient->post( diff --git a/src/Model/Generated/Endpoint/AttachmentTab.php b/src/Model/Generated/Endpoint/AttachmentTab.php index dbf002a8..8265882a 100644 --- a/src/Model/Generated/Endpoint/AttachmentTab.php +++ b/src/Model/Generated/Endpoint/AttachmentTab.php @@ -69,12 +69,16 @@ class AttachmentTab extends BunqModel * X-Bunq-Attachment-Description header. * * @param string $requestBytes + * @param int|null $monetaryAccountId * @param string[] $customHeaders * * @return BunqResponseInt */ - public static function create(string $requestBytes, array $customHeaders = []): BunqResponseInt - { + public static function create( + string $requestBytes, + int $monetaryAccountId = null, + array $customHeaders = [] + ): BunqResponseInt { $apiClient = new ApiClient(static::getApiContext()); $apiClient->enableBinary(); $responseRaw = $apiClient->post( diff --git a/src/Model/Generated/Endpoint/BunqMeFundraiserProfileUser.php b/src/Model/Generated/Endpoint/BunqMeFundraiserProfileUser.php index 45b70810..4af47d11 100644 --- a/src/Model/Generated/Endpoint/BunqMeFundraiserProfileUser.php +++ b/src/Model/Generated/Endpoint/BunqMeFundraiserProfileUser.php @@ -43,6 +43,13 @@ class BunqMeFundraiserProfileUser extends BunqModel */ protected $monetaryAccountId; + /** + * Id of the user owning the profile. + * + * @var int + */ + protected $ownerUserId; + /** * The color chosen for the bunq.me fundraiser profile in hexadecimal * format. @@ -258,6 +265,27 @@ public function setMonetaryAccountId($monetaryAccountId) $this->monetaryAccountId = $monetaryAccountId; } + /** + * Id of the user owning the profile. + * + * @return int + */ + public function getOwnerUserId() + { + return $this->ownerUserId; + } + + /** + * @param int $ownerUserId + * + * @deprecated User should not be able to set values via setters, use + * constructor. + */ + public function setOwnerUserId($ownerUserId) + { + $this->ownerUserId = $ownerUserId; + } + /** * The color chosen for the bunq.me fundraiser profile in hexadecimal * format. @@ -418,6 +446,10 @@ public function isAllFieldNull() return false; } + if (!is_null($this->ownerUserId)) { + return false; + } + if (!is_null($this->color)) { return false; } diff --git a/src/Model/Generated/Endpoint/Device.php b/src/Model/Generated/Endpoint/Device.php index 80226d33..f737e453 100644 --- a/src/Model/Generated/Endpoint/Device.php +++ b/src/Model/Generated/Endpoint/Device.php @@ -1,7 +1,7 @@ balanceAfterMutation = $balanceAfterMutation; } - /** - * A reference to the PaymentAutoAllocateInstance if it exists. - * - * @return PaymentAutoAllocateInstance - */ - public function getPaymentAutoAllocateInstance() - { - return $this->paymentAutoAllocateInstance; - } - - /** - * @param PaymentAutoAllocateInstance $paymentAutoAllocateInstance - * - * @deprecated User should not be able to set values via setters, use - * constructor. - */ - public function setPaymentAutoAllocateInstance($paymentAutoAllocateInstance) - { - $this->paymentAutoAllocateInstance = $paymentAutoAllocateInstance; - } - /** * @return bool */ @@ -1066,10 +1038,6 @@ public function isAllFieldNull() return false; } - if (!is_null($this->paymentAutoAllocateInstance)) { - return false; - } - return true; } } diff --git a/src/Model/Generated/Endpoint/PaymentAutoAllocateUser.php b/src/Model/Generated/Endpoint/PaymentAutoAllocateUser.php index 7be4e4ca..e929e45f 100644 --- a/src/Model/Generated/Endpoint/PaymentAutoAllocateUser.php +++ b/src/Model/Generated/Endpoint/PaymentAutoAllocateUser.php @@ -1,7 +1,7 @@ allocations = $allocations; } - /** - * The object that is connected to this RegistryEntry. - * - * @return BunqModel - */ - public function getObject() - { - return $this->object; - } - - /** - * @param BunqModel $object - * - * @deprecated User should not be able to set values via setters, use - * constructor. - */ - public function setObject($object) - { - $this->object = $object; - } - /** * The attachments attached to the payment. * @@ -802,10 +774,6 @@ public function isAllFieldNull() return false; } - if (!is_null($this->object)) { - return false; - } - if (!is_null($this->attachment)) { return false; } diff --git a/src/Model/Generated/Endpoint/Tab.php b/src/Model/Generated/Endpoint/Tab.php index 33f1b7b8..9f055c90 100644 --- a/src/Model/Generated/Endpoint/Tab.php +++ b/src/Model/Generated/Endpoint/Tab.php @@ -1,7 +1,7 @@ key; + } + + /** + * @param string $key + * + * @deprecated User should not be able to set values via setters, use + * constructor. + */ + public function setKey($key) + { + $this->key = $key; + } + + /** + * The field's input type: "text", "select" or "radio". + * + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * @param string $type + * + * @deprecated User should not be able to set values via setters, use + * constructor. + */ + public function setType($type) + { + $this->type = $type; + } + + /** + * The field name. + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @param string $name + * + * @deprecated User should not be able to set values via setters, use + * constructor. + */ + public function setName($name) + { + $this->name = $name; + } + + /** + * Indicates that any changes in this field affect the requirements, if this + * field is changed, the requirements endpoint must be called again to + * recheck if there are any additional requirements. + * + * @return bool + */ + public function getRefreshRequirementsOnChange() + { + return $this->refreshRequirementsOnChange; + } + + /** + * @param bool $refreshRequirementsOnChange + * + * @deprecated User should not be able to set values via setters, use + * constructor. + */ + public function setRefreshRequirementsOnChange($refreshRequirementsOnChange) + { + $this->refreshRequirementsOnChange = $refreshRequirementsOnChange; + } + + /** + * Whether or not the field is required. + * + * @return bool + */ + public function getRequired() + { + return $this->required; + } + + /** + * @param bool $required + * + * @deprecated User should not be able to set values via setters, use + * constructor. + */ + public function setRequired($required) + { + $this->required = $required; + } + + /** + * Formatting mask to guide user input. + * + * @return string + */ + public function getDisplayFormat() + { + return $this->displayFormat; + } + + /** + * @param string $displayFormat + * + * @deprecated User should not be able to set values via setters, use + * constructor. + */ + public function setDisplayFormat($displayFormat) + { + $this->displayFormat = $displayFormat; + } + + /** + * An example value for this field. + * + * @return string + */ + public function getExample() + { + return $this->example; + } + + /** + * @param string $example + * + * @deprecated User should not be able to set values via setters, use + * constructor. + */ + public function setExample($example) + { + $this->example = $example; + } + + /** + * The minimum length of the field's value. + * + * @return string + */ + public function getMinLength() + { + return $this->minLength; + } + + /** + * @param string $minLength + * + * @deprecated User should not be able to set values via setters, use + * constructor. + */ + public function setMinLength($minLength) + { + $this->minLength = $minLength; + } + + /** + * The maximum length of the field's value. + * + * @return string + */ + public function getMaxLength() + { + return $this->maxLength; + } + + /** + * @param string $maxLength + * + * @deprecated User should not be able to set values via setters, use + * constructor. + */ + public function setMaxLength($maxLength) + { + $this->maxLength = $maxLength; + } + + /** + * A regular expression which may be used to validate the user input. + * + * @return string + */ + public function getValidationRegexp() + { + return $this->validationRegexp; + } + + /** + * @param string $validationRegexp + * + * @deprecated User should not be able to set values via setters, use + * constructor. + */ + public function setValidationRegexp($validationRegexp) + { + $this->validationRegexp = $validationRegexp; + } + + /** + * Details of an endpoint which may be used to validate the user input. + * + * @return TransferwiseRequirementFieldGroupValidationAsync + */ + public function getValidationAsync() + { + return $this->validationAsync; + } + + /** + * @param TransferwiseRequirementFieldGroupValidationAsync $validationAsync + * + * @deprecated User should not be able to set values via setters, use + * constructor. + */ + public function setValidationAsync($validationAsync) + { + $this->validationAsync = $validationAsync; + } + + /** + * Shows which values are allowed for fields of type "select" or "radio". + * + * @return TransferwiseRequirementFieldGroupValuesAllowed + */ + public function getValuesAllowed() + { + return $this->valuesAllowed; + } + + /** + * @param TransferwiseRequirementFieldGroupValuesAllowed $valuesAllowed + * + * @deprecated User should not be able to set values via setters, use + * constructor. + */ + public function setValuesAllowed($valuesAllowed) + { + $this->valuesAllowed = $valuesAllowed; + } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->key)) { + return false; + } + + if (!is_null($this->type)) { + return false; + } + + if (!is_null($this->name)) { + return false; + } + + if (!is_null($this->refreshRequirementsOnChange)) { + return false; + } + + if (!is_null($this->required)) { + return false; + } + + if (!is_null($this->displayFormat)) { + return false; + } + + if (!is_null($this->example)) { + return false; + } + + if (!is_null($this->minLength)) { + return false; + } + + if (!is_null($this->maxLength)) { + return false; + } + + if (!is_null($this->validationRegexp)) { + return false; + } + + if (!is_null($this->validationAsync)) { + return false; + } + + if (!is_null($this->valuesAllowed)) { + return false; + } + + return true; + } +} diff --git a/src/Model/Generated/Object/TransferwiseRequirementFieldGroupValidationAsync.php b/src/Model/Generated/Object/TransferwiseRequirementFieldGroupValidationAsync.php new file mode 100644 index 00000000..1e8782aa --- /dev/null +++ b/src/Model/Generated/Object/TransferwiseRequirementFieldGroupValidationAsync.php @@ -0,0 +1,82 @@ +url; + } + + /** + * @param string $url + * + * @deprecated User should not be able to set values via setters, use + * constructor. + */ + public function setUrl($url) + { + $this->url = $url; + } + + /** + * The parameters to send when validating user input. + * + * @return TransferwiseRequirementFieldGroupValidationAsyncParams + */ + public function getParams() + { + return $this->params; + } + + /** + * @param TransferwiseRequirementFieldGroupValidationAsyncParams $params + * + * @deprecated User should not be able to set values via setters, use + * constructor. + */ + public function setParams($params) + { + $this->params = $params; + } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->url)) { + return false; + } + + if (!is_null($this->params)) { + return false; + } + + return true; + } +} diff --git a/src/Model/Generated/Object/TransferwiseRequirementFieldGroupValidationAsyncParams.php b/src/Model/Generated/Object/TransferwiseRequirementFieldGroupValidationAsyncParams.php new file mode 100644 index 00000000..1527ab2e --- /dev/null +++ b/src/Model/Generated/Object/TransferwiseRequirementFieldGroupValidationAsyncParams.php @@ -0,0 +1,114 @@ +key; + } + + /** + * @param string $key + * + * @deprecated User should not be able to set values via setters, use + * constructor. + */ + public function setKey($key) + { + $this->key = $key; + } + + /** + * The parameter label. + * + * @return string + */ + public function getParameterName() + { + return $this->parameterName; + } + + /** + * @param string $parameterName + * + * @deprecated User should not be able to set values via setters, use + * constructor. + */ + public function setParameterName($parameterName) + { + $this->parameterName = $parameterName; + } + + /** + * Shows whether the parameter is required or not. + * + * @return bool + */ + public function getRequired() + { + return $this->required; + } + + /** + * @param bool $required + * + * @deprecated User should not be able to set values via setters, use + * constructor. + */ + public function setRequired($required) + { + $this->required = $required; + } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->key)) { + return false; + } + + if (!is_null($this->parameterName)) { + return false; + } + + if (!is_null($this->required)) { + return false; + } + + return true; + } +} diff --git a/src/Model/Generated/Object/TransferwiseRequirementFieldGroupValuesAllowed.php b/src/Model/Generated/Object/TransferwiseRequirementFieldGroupValuesAllowed.php new file mode 100644 index 00000000..a8186cbf --- /dev/null +++ b/src/Model/Generated/Object/TransferwiseRequirementFieldGroupValuesAllowed.php @@ -0,0 +1,82 @@ +key; + } + + /** + * @param string $key + * + * @deprecated User should not be able to set values via setters, use + * constructor. + */ + public function setKey($key) + { + $this->key = $key; + } + + /** + * The label. + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @param string $name + * + * @deprecated User should not be able to set values via setters, use + * constructor. + */ + public function setName($name) + { + $this->name = $name; + } + + /** + * @return bool + */ + public function isAllFieldNull() + { + if (!is_null($this->key)) { + return false; + } + + if (!is_null($this->name)) { + return false; + } + + return true; + } +} diff --git a/src/Model/Generated/Object/UserApiKeyAnchoredUser.php b/src/Model/Generated/Object/UserApiKeyAnchoredUser.php index dc94867b..56bc6236 100644 --- a/src/Model/Generated/Object/UserApiKeyAnchoredUser.php +++ b/src/Model/Generated/Object/UserApiKeyAnchoredUser.php @@ -1,7 +1,7 @@ + * @since 20200813 Initial creation. + */ +class OauthAuthorizationUriTest extends BunqSdkTestBase +{ + const TEST_EXPECT_URI = 'https://oauth.sandbox.bunq.com/auth?redirect_uri=redirecturi&response_type=code&state=state'; + const TEST_REDIRECT_URI = 'redirecturi'; + const TEST_STATUS = 'status'; + const TEST_STATE = 'state'; + + /** + */ + public function testAdditionalOathUriParameters() + { + $uri = OauthAuthorizationUri::create( + BunqEnumOauthResponseType::CODE(), + self::TEST_REDIRECT_URI, + new OauthClient(self::TEST_STATUS), + self::TEST_STATE + )->getAuthorizationUriString(); + + static::assertEquals(self::TEST_EXPECT_URI, $uri); + } +}