diff --git a/src/Http/ApiClient.php b/src/Http/ApiClient.php index 3c14846a..dafa79ae 100644 --- a/src/Http/ApiClient.php +++ b/src/Http/ApiClient.php @@ -85,7 +85,7 @@ class ApiClient /** * User agent constants. */ - const HEADER_USER_AGENT_BUNQ_SDK_DEFAULT = 'bunq-sdk-php/1.0.0'; + const HEADER_USER_AGENT_BUNQ_SDK_DEFAULT = 'bunq-sdk-php/1.1.0'; /** * Binary request constants. diff --git a/src/Model/Generated/Endpoint/BunqMeTabEntry.php b/src/Model/Generated/Endpoint/BunqMeTabEntry.php index baffb37d..a3ec31bf 100644 --- a/src/Model/Generated/Endpoint/BunqMeTabEntry.php +++ b/src/Model/Generated/Endpoint/BunqMeTabEntry.php @@ -76,7 +76,7 @@ class BunqMeTabEntry extends BunqModel /** * The Amount requested to be paid. Can be optional. * - * @var Amount|null + * @var Amount */ protected $amountInquiredFieldForRequest; @@ -96,14 +96,14 @@ class BunqMeTabEntry extends BunqModel protected $redirectUrlFieldForRequest; /** - * @param string $description The description for the bunq.me. Maximum 9000 - * characters. Field is required but can be an empty string. - * @param Amount|null $amountInquired The Amount requested to be paid. Can - * be optional. - * @param string|null $redirectUrl The URL which the user is sent to after - * making a payment. + * @param Amount $amountInquired The Amount requested to be paid. Can be + * optional. + * @param string $description The description for the bunq.me. Maximum 9000 + * characters. Field is required but can be an empty string. + * @param string|null $redirectUrl The URL which the user is sent to after + * making a payment. */ - public function __construct(string $description, Amount $amountInquired = null, string $redirectUrl = null) + public function __construct(Amount $amountInquired, string $description, string $redirectUrl = null) { $this->amountInquiredFieldForRequest = $amountInquired; $this->descriptionFieldForRequest = $description; diff --git a/src/Model/Generated/Endpoint/Card.php b/src/Model/Generated/Endpoint/Card.php index 769febb0..a03eec73 100644 --- a/src/Model/Generated/Endpoint/Card.php +++ b/src/Model/Generated/Endpoint/Card.php @@ -3,6 +3,7 @@ use bunq\Http\ApiClient; use bunq\Model\Core\BunqModel; +use bunq\Model\Generated\Object\Amount; use bunq\Model\Generated\Object\CardCountryPermission; use bunq\Model\Generated\Object\CardLimit; use bunq\Model\Generated\Object\CardMagStripePermission; @@ -29,6 +30,7 @@ class Card extends BunqModel const FIELD_PIN_CODE = 'pin_code'; const FIELD_ACTIVATION_CODE = 'activation_code'; const FIELD_STATUS = 'status'; + const FIELD_CARD_LIMIT = 'card_limit'; const FIELD_LIMIT = 'limit'; const FIELD_MAG_STRIPE_PERMISSION = 'mag_stripe_permission'; const FIELD_COUNTRY_PERMISSION = 'country_permission'; @@ -136,9 +138,16 @@ class Card extends BunqModel protected $primaryAccountNumberFourDigit; /** - * The limits to define for the card, among CARD_LIMIT_CONTACTLESS, - * CARD_LIMIT_ATM, CARD_LIMIT_DIPPING and CARD_LIMIT_POS_ICC (e.g. 25 EUR - * for CARD_LIMIT_CONTACTLESS) + * The spending limit for the cards + * + * @var Amount + */ + protected $cardLimit; + + /** + * DEPRECATED: The limits to define for the card, among + * CARD_LIMIT_CONTACTLESS, CARD_LIMIT_ATM, CARD_LIMIT_DIPPING and + * CARD_LIMIT_POS_ICC (e.g. 25 EUR for CARD_LIMIT_CONTACTLESS) * * @var CardLimit[] */ @@ -229,9 +238,17 @@ class Card extends BunqModel protected $statusFieldForRequest; /** - * The limits to define for the card, among CARD_LIMIT_CONTACTLESS, - * CARD_LIMIT_ATM, CARD_LIMIT_DIPPING and CARD_LIMIT_POS_ICC (e.g. 25 EUR - * for CARD_LIMIT_CONTACTLESS). All the limits must be provided on update. + * The spending limit for the card. + * + * @var Amount|null + */ + protected $cardLimitFieldForRequest; + + /** + * DEPRECATED: The limits to define for the card, among + * CARD_LIMIT_CONTACTLESS, CARD_LIMIT_ATM, CARD_LIMIT_DIPPING and + * CARD_LIMIT_POS_ICC (e.g. 25 EUR for CARD_LIMIT_CONTACTLESS). All the + * limits must be provided on update. * * @var CardLimit[]|null */ @@ -283,8 +300,9 @@ class Card extends BunqModel * Mind that all the possible choices (apart from ACTIVE * and DEACTIVATED) are permanent and cannot be changed * after. - * @param CardLimit[]|null $limit The limits to define for the card, among - * CARD_LIMIT_CONTACTLESS, CARD_LIMIT_ATM, + * @param Amount|null $cardLimit The spending limit for the card. + * @param CardLimit[]|null $limit DEPRECATED: The limits to define for the + * card, among CARD_LIMIT_CONTACTLESS, CARD_LIMIT_ATM, * CARD_LIMIT_DIPPING and CARD_LIMIT_POS_ICC (e.g. 25 EUR * for CARD_LIMIT_CONTACTLESS). All the limits must be * provided on update. @@ -302,6 +320,7 @@ public function __construct( string $pinCode = null, string $activationCode = null, string $status = null, + Amount $cardLimit = null, array $limit = null, CardMagStripePermission $magStripePermission = null, array $countryPermission = null, @@ -311,6 +330,7 @@ public function __construct( $this->pinCodeFieldForRequest = $pinCode; $this->activationCodeFieldForRequest = $activationCode; $this->statusFieldForRequest = $status; + $this->cardLimitFieldForRequest = $cardLimit; $this->limitFieldForRequest = $limit; $this->magStripePermissionFieldForRequest = $magStripePermission; $this->countryPermissionFieldForRequest = $countryPermission; @@ -341,8 +361,9 @@ public function __construct( * Mind that all the possible choices (apart from ACTIVE * and DEACTIVATED) are permanent and cannot be changed * after. - * @param CardLimit[]|null $limit The limits to define for the card, among - * CARD_LIMIT_CONTACTLESS, CARD_LIMIT_ATM, + * @param Amount|null $cardLimit The spending limit for the card. + * @param CardLimit[]|null $limit DEPRECATED: The limits to define for the + * card, among CARD_LIMIT_CONTACTLESS, CARD_LIMIT_ATM, * CARD_LIMIT_DIPPING and CARD_LIMIT_POS_ICC (e.g. 25 EUR * for CARD_LIMIT_CONTACTLESS). All the limits must be * provided on update. @@ -364,6 +385,7 @@ public static function update( string $pinCode = null, string $activationCode = null, string $status = null, + Amount $cardLimit = null, array $limit = null, CardMagStripePermission $magStripePermission = null, array $countryPermission = null, @@ -382,6 +404,7 @@ public static function update( self::FIELD_PIN_CODE => $pinCode, self::FIELD_ACTIVATION_CODE => $activationCode, self::FIELD_STATUS => $status, + self::FIELD_CARD_LIMIT => $cardLimit, self::FIELD_LIMIT => $limit, self::FIELD_MAG_STRIPE_PERMISSION => $magStripePermission, self::FIELD_COUNTRY_PERMISSION => $countryPermission, @@ -726,9 +749,30 @@ public function setPrimaryAccountNumberFourDigit($primaryAccountNumberFourDigit) } /** - * The limits to define for the card, among CARD_LIMIT_CONTACTLESS, - * CARD_LIMIT_ATM, CARD_LIMIT_DIPPING and CARD_LIMIT_POS_ICC (e.g. 25 EUR - * for CARD_LIMIT_CONTACTLESS) + * The spending limit for the cards + * + * @return Amount + */ + public function getCardLimit() + { + return $this->cardLimit; + } + + /** + * @deprecated User should not be able to set values via setters, use + * constructor. + * + * @param Amount $cardLimit + */ + public function setCardLimit($cardLimit) + { + $this->cardLimit = $cardLimit; + } + + /** + * DEPRECATED: The limits to define for the card, among + * CARD_LIMIT_CONTACTLESS, CARD_LIMIT_ATM, CARD_LIMIT_DIPPING and + * CARD_LIMIT_POS_ICC (e.g. 25 EUR for CARD_LIMIT_CONTACTLESS) * * @return CardLimit[] */ @@ -956,6 +1000,10 @@ public function isAllFieldNull() return false; } + if (!is_null($this->cardLimit)) { + return false; + } + if (!is_null($this->limit)) { return false; } diff --git a/src/Model/Generated/Endpoint/CustomerLimit.php b/src/Model/Generated/Endpoint/CustomerLimit.php index ed4dbf8e..db3294d8 100644 --- a/src/Model/Generated/Endpoint/CustomerLimit.php +++ b/src/Model/Generated/Endpoint/CustomerLimit.php @@ -3,6 +3,7 @@ use bunq\Http\ApiClient; use bunq\Model\Core\BunqModel; +use bunq\Model\Generated\Object\Amount; /** * Show the limits for the authenticated user. @@ -56,6 +57,27 @@ class CustomerLimit extends BunqModel */ protected $limitCardDebitReplacement; + /** + * The number of "PREMIUM_LIMITED" invites the user has remaining. + * + * @var int + */ + protected $limitInviteUserPremiumLimited; + + /** + * The maximum amount a user is allowed to spend in a month. + * + * @var Amount + */ + protected $limitAmountMonthly; + + /** + * The amount the user has spent in the last month. + * + * @var Amount + */ + protected $spentAmountMonthly; + /** * Get all limits for the authenticated user. * @@ -189,6 +211,69 @@ public function setLimitCardDebitReplacement($limitCardDebitReplacement) $this->limitCardDebitReplacement = $limitCardDebitReplacement; } + /** + * The number of "PREMIUM_LIMITED" invites the user has remaining. + * + * @return int + */ + public function getLimitInviteUserPremiumLimited() + { + return $this->limitInviteUserPremiumLimited; + } + + /** + * @deprecated User should not be able to set values via setters, use + * constructor. + * + * @param int $limitInviteUserPremiumLimited + */ + public function setLimitInviteUserPremiumLimited($limitInviteUserPremiumLimited) + { + $this->limitInviteUserPremiumLimited = $limitInviteUserPremiumLimited; + } + + /** + * The maximum amount a user is allowed to spend in a month. + * + * @return Amount + */ + public function getLimitAmountMonthly() + { + return $this->limitAmountMonthly; + } + + /** + * @deprecated User should not be able to set values via setters, use + * constructor. + * + * @param Amount $limitAmountMonthly + */ + public function setLimitAmountMonthly($limitAmountMonthly) + { + $this->limitAmountMonthly = $limitAmountMonthly; + } + + /** + * The amount the user has spent in the last month. + * + * @return Amount + */ + public function getSpentAmountMonthly() + { + return $this->spentAmountMonthly; + } + + /** + * @deprecated User should not be able to set values via setters, use + * constructor. + * + * @param Amount $spentAmountMonthly + */ + public function setSpentAmountMonthly($spentAmountMonthly) + { + $this->spentAmountMonthly = $spentAmountMonthly; + } + /** * @return bool */ @@ -214,6 +299,18 @@ public function isAllFieldNull() return false; } + if (!is_null($this->limitInviteUserPremiumLimited)) { + return false; + } + + if (!is_null($this->limitAmountMonthly)) { + return false; + } + + if (!is_null($this->spentAmountMonthly)) { + return false; + } + return true; } } diff --git a/src/Model/Generated/Endpoint/MasterCardAction.php b/src/Model/Generated/Endpoint/MasterCardAction.php index 9e06a9cb..ca87e881 100644 --- a/src/Model/Generated/Endpoint/MasterCardAction.php +++ b/src/Model/Generated/Endpoint/MasterCardAction.php @@ -141,6 +141,13 @@ class MasterCardAction extends BunqModel */ protected $panEntryModeUser; + /** + * The setlement status in the authorisation process. + * + * @var string + */ + protected $settlementStatus; + /** * The city where the message originates from as announced by the terminal. * @@ -626,6 +633,27 @@ public function setPanEntryModeUser($panEntryModeUser) $this->panEntryModeUser = $panEntryModeUser; } + /** + * The setlement status in the authorisation process. + * + * @return string + */ + public function getSettlementStatus() + { + return $this->settlementStatus; + } + + /** + * @deprecated User should not be able to set values via setters, use + * constructor. + * + * @param string $settlementStatus + */ + public function setSettlementStatus($settlementStatus) + { + $this->settlementStatus = $settlementStatus; + } + /** * The city where the message originates from as announced by the terminal. * @@ -952,6 +980,10 @@ public function isAllFieldNull() return false; } + if (!is_null($this->settlementStatus)) { + return false; + } + if (!is_null($this->city)) { return false; } diff --git a/src/Model/Generated/Endpoint/RequestResponse.php b/src/Model/Generated/Endpoint/RequestResponse.php index d050f02a..96d79634 100644 --- a/src/Model/Generated/Endpoint/RequestResponse.php +++ b/src/Model/Generated/Endpoint/RequestResponse.php @@ -8,6 +8,7 @@ use bunq\Model\Generated\Object\Attachment; use bunq\Model\Generated\Object\Geolocation; use bunq\Model\Generated\Object\LabelMonetaryAccount; +use bunq\Model\Generated\Object\LabelUser; use bunq\Model\Generated\Object\RequestInquiryReference; /** @@ -78,6 +79,28 @@ class RequestResponse extends BunqModel */ protected $timeExpiry; + /** + * The timestamp of when a refund request for the RequestResponse was + * claimed. + * + * @var string + */ + protected $timeRefundRequested; + + /** + * The timestamp of when the RequestResponse was refunded. + * + * @var string + */ + protected $timeRefunded; + + /** + * The label of the user that requested the refund. + * + * @var LabelUser + */ + protected $userRefundRequested; + /** * The id of the MonetaryAccount the RequestResponse was received on. * @@ -100,8 +123,8 @@ class RequestResponse extends BunqModel protected $amountResponded; /** - * The status of the RequestResponse. Can be ACCEPTED, PENDING, REJECTED or - * REVOKED. + * The status of the RequestResponse. Can be ACCEPTED, PENDING, REJECTED, + * REFUND_REQUESTED, REFUNDED or REVOKED. * * @var string */ @@ -506,6 +529,70 @@ public function setTimeExpiry($timeExpiry) $this->timeExpiry = $timeExpiry; } + /** + * The timestamp of when a refund request for the RequestResponse was + * claimed. + * + * @return string + */ + public function getTimeRefundRequested() + { + return $this->timeRefundRequested; + } + + /** + * @deprecated User should not be able to set values via setters, use + * constructor. + * + * @param string $timeRefundRequested + */ + public function setTimeRefundRequested($timeRefundRequested) + { + $this->timeRefundRequested = $timeRefundRequested; + } + + /** + * The timestamp of when the RequestResponse was refunded. + * + * @return string + */ + public function getTimeRefunded() + { + return $this->timeRefunded; + } + + /** + * @deprecated User should not be able to set values via setters, use + * constructor. + * + * @param string $timeRefunded + */ + public function setTimeRefunded($timeRefunded) + { + $this->timeRefunded = $timeRefunded; + } + + /** + * The label of the user that requested the refund. + * + * @return LabelUser + */ + public function getUserRefundRequested() + { + return $this->userRefundRequested; + } + + /** + * @deprecated User should not be able to set values via setters, use + * constructor. + * + * @param LabelUser $userRefundRequested + */ + public function setUserRefundRequested($userRefundRequested) + { + $this->userRefundRequested = $userRefundRequested; + } + /** * The id of the MonetaryAccount the RequestResponse was received on. * @@ -570,8 +657,8 @@ public function setAmountResponded($amountResponded) } /** - * The status of the RequestResponse. Can be ACCEPTED, PENDING, REJECTED or - * REVOKED. + * The status of the RequestResponse. Can be ACCEPTED, PENDING, REJECTED, + * REFUND_REQUESTED, REFUNDED or REVOKED. * * @return string */ @@ -983,6 +1070,18 @@ public function isAllFieldNull() return false; } + if (!is_null($this->timeRefundRequested)) { + return false; + } + + if (!is_null($this->timeRefunded)) { + return false; + } + + if (!is_null($this->userRefundRequested)) { + return false; + } + if (!is_null($this->monetaryAccountId)) { return false; } diff --git a/src/Model/Generated/Endpoint/ShareInviteBankResponse.php b/src/Model/Generated/Endpoint/ShareInviteBankResponse.php index dc5d1b44..e50b9190 100644 --- a/src/Model/Generated/Endpoint/ShareInviteBankResponse.php +++ b/src/Model/Generated/Endpoint/ShareInviteBankResponse.php @@ -33,6 +33,27 @@ class ShareInviteBankResponse extends BunqModel */ const OBJECT_TYPE_GET = 'ShareInviteBankResponse'; + /** + * The id of the ShareInviteBankResponse. + * + * @var int + */ + protected $id; + + /** + * The timestamp of the ShareInviteBankResponse creation. + * + * @var string + */ + protected $created; + + /** + * The timestamp of the ShareInviteBankResponse last update. + * + * @var string + */ + protected $updated; + /** * The monetary account and user who created the share. * @@ -220,6 +241,69 @@ public static function listing( ); } + /** + * The id of the ShareInviteBankResponse. + * + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * @deprecated User should not be able to set values via setters, use + * constructor. + * + * @param int $id + */ + public function setId($id) + { + $this->id = $id; + } + + /** + * The timestamp of the ShareInviteBankResponse creation. + * + * @return string + */ + public function getCreated() + { + return $this->created; + } + + /** + * @deprecated User should not be able to set values via setters, use + * constructor. + * + * @param string $created + */ + public function setCreated($created) + { + $this->created = $created; + } + + /** + * The timestamp of the ShareInviteBankResponse last update. + * + * @return string + */ + public function getUpdated() + { + return $this->updated; + } + + /** + * @deprecated User should not be able to set values via setters, use + * constructor. + * + * @param string $updated + */ + public function setUpdated($updated) + { + $this->updated = $updated; + } + /** * The monetary account and user who created the share. * @@ -440,6 +524,18 @@ public function setDescription($description) */ public function isAllFieldNull() { + if (!is_null($this->id)) { + return false; + } + + if (!is_null($this->created)) { + return false; + } + + if (!is_null($this->updated)) { + return false; + } + if (!is_null($this->counterAlias)) { return false; } diff --git a/src/Model/Generated/Object/CardBatchEntry.php b/src/Model/Generated/Object/CardBatchEntry.php index b722e3e9..827f6876 100644 --- a/src/Model/Generated/Object/CardBatchEntry.php +++ b/src/Model/Generated/Object/CardBatchEntry.php @@ -40,14 +40,22 @@ class CardBatchEntry extends BunqModel protected $statusFieldForRequest; /** - * The limits to define for the card, among CARD_LIMIT_CONTACTLESS, - * CARD_LIMIT_ATM, CARD_LIMIT_DIPPING and CARD_LIMIT_POS_ICC (e.g. 25 EUR - * for CARD_LIMIT_CONTACTLESS). All the limits must be provided on update. + * DEPRECATED: The limits to define for the card, among + * CARD_LIMIT_CONTACTLESS, CARD_LIMIT_ATM, CARD_LIMIT_DIPPING and + * CARD_LIMIT_POS_ICC (e.g. 25 EUR for CARD_LIMIT_CONTACTLESS). All the + * limits must be provided on update. * * @var CardLimit[]|null */ protected $limitFieldForRequest; + /** + * The limit to define for the card. + * + * @var Amount|null + */ + protected $cardLimitFieldForRequest; + /** * Whether or not it is allowed to use the mag stripe for the card. * @@ -86,11 +94,12 @@ class CardBatchEntry extends BunqModel * Mind that all the possible choices (apart from ACTIVE * and DEACTIVATED) are permanent and cannot be changed * after. - * @param CardLimit[]|null $limit The limits to define for the card, among - * CARD_LIMIT_CONTACTLESS, CARD_LIMIT_ATM, + * @param CardLimit[]|null $limit DEPRECATED: The limits to define for the + * card, among CARD_LIMIT_CONTACTLESS, CARD_LIMIT_ATM, * CARD_LIMIT_DIPPING and CARD_LIMIT_POS_ICC (e.g. 25 EUR * for CARD_LIMIT_CONTACTLESS). All the limits must be * provided on update. + * @param Amount|null $cardLimit The limit to define for the card. * @param CardMagStripePermission|null $magStripePermission Whether or not * it is allowed to use the mag stripe for the card. * @param CardCountryPermission[]|null $countryPermission The countries for @@ -104,6 +113,7 @@ public function __construct( string $activationCode = null, string $status = null, array $limit = null, + Amount $cardLimit = null, CardMagStripePermission $magStripePermission = null, array $countryPermission = null, int $monetaryAccountIdFallback = null @@ -112,6 +122,7 @@ public function __construct( $this->activationCodeFieldForRequest = $activationCode; $this->statusFieldForRequest = $status; $this->limitFieldForRequest = $limit; + $this->cardLimitFieldForRequest = $cardLimit; $this->magStripePermissionFieldForRequest = $magStripePermission; $this->countryPermissionFieldForRequest = $countryPermission; $this->monetaryAccountIdFallbackFieldForRequest = $monetaryAccountIdFallback; diff --git a/tests/Model/Generated/Endpoint/BunqMeTabEntryTest.php b/tests/Model/Generated/Endpoint/BunqMeTabEntryTest.php index 93ab5684..8a76ddd2 100644 --- a/tests/Model/Generated/Endpoint/BunqMeTabEntryTest.php +++ b/tests/Model/Generated/Endpoint/BunqMeTabEntryTest.php @@ -24,8 +24,8 @@ public function testBunqMeTab() { $response = BunqMeTab::create( new BunqMeTabEntry( - self::ENTRY_DESCRIPTION, - new Amount(self::PAYMENT_AMOUNT_DEFAULT, self::MONETARY_ACCOUNT_CURRENCY) + new Amount(self::PAYMENT_AMOUNT_DEFAULT, self::MONETARY_ACCOUNT_CURRENCY), + self::ENTRY_DESCRIPTION ) );