Skip to content

Commit

Permalink
Merge branch 'release/1.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin Yakushev committed Nov 21, 2018
2 parents 982bd08 + 5a1e634 commit 64c795e
Show file tree
Hide file tree
Showing 14 changed files with 1,264 additions and 464 deletions.
26 changes: 0 additions & 26 deletions src/Model/Generated/Endpoint/BillingContractSubscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class BillingContractSubscription extends BunqModel
/**
* Endpoint constants.
*/
const ENDPOINT_URL_CREATE = 'user/%s/billing-contract-subscription';
const ENDPOINT_URL_LISTING = 'user/%s/billing-contract-subscription';

/**
Expand Down Expand Up @@ -119,31 +118,6 @@ public function __construct(string $subscriptionType)
$this->subscriptionTypeFieldForRequest = $subscriptionType;
}

/**
* @param string $subscriptionType The subscription type of the user. Can be
* one of PERSON_LIGHT_V1, PERSON_MORE_V1, PERSON_FREE_V1,
* PERSON_PREMIUM_V1, COMPANY_V1, or COMPANY_V2.
* @param string[] $customHeaders
*
* @return BunqResponseInt
*/
public static function create(string $subscriptionType, array $customHeaders = []): BunqResponseInt
{
$apiClient = new ApiClient(static::getApiContext());
$responseRaw = $apiClient->post(
vsprintf(
self::ENDPOINT_URL_CREATE,
[static::determineUserId()]
),
[self::FIELD_SUBSCRIPTION_TYPE => $subscriptionType],
$customHeaders
);

return BunqResponseInt::castFromBunqResponse(
static::processForId($responseRaw)
);
}

/**
* Get all subscription billing contract for the authenticated user.
*
Expand Down
17 changes: 0 additions & 17 deletions src/Model/Generated/Endpoint/BunqResponseMonetaryAccountLight.php

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
namespace bunq\Model\Generated\Endpoint;

use bunq\Http\BunqResponse;

/**
*/
class BunqResponseMonetaryAccountSavings extends BunqResponse
{
/**
* @return MonetaryAccountSavings
*/
public function getValue(): MonetaryAccountSavings
{
return parent::getValue();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

/**
*/
class BunqResponseMonetaryAccountLightList extends BunqResponse
class BunqResponseMonetaryAccountSavingsList extends BunqResponse
{
/**
* @return MonetaryAccountLight[]
* @return MonetaryAccountSavings[]
*/
public function getValue(): array
{
Expand Down

This file was deleted.

This file was deleted.

17 changes: 0 additions & 17 deletions src/Model/Generated/Endpoint/BunqResponseUserLight.php

This file was deleted.

50 changes: 48 additions & 2 deletions src/Model/Generated/Endpoint/Card.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class Card extends BunqModel
const FIELD_ACTIVATION_CODE = 'activation_code';
const FIELD_STATUS = 'status';
const FIELD_CARD_LIMIT = 'card_limit';
const FIELD_CARD_LIMIT_ATM = 'card_limit_atm';
const FIELD_LIMIT = 'limit';
const FIELD_MAG_STRIPE_PERMISSION = 'mag_stripe_permission';
const FIELD_COUNTRY_PERMISSION = 'country_permission';
Expand Down Expand Up @@ -138,12 +139,19 @@ class Card extends BunqModel
protected $primaryAccountNumberFourDigit;

/**
* The spending limit for the cards
* The spending limit for the card.
*
* @var Amount
*/
protected $cardLimit;

/**
* The ATM spending limit for the card.
*
* @var Amount
*/
protected $cardLimitAtm;

/**
* DEPRECATED: The limits to define for the card, among
* CARD_LIMIT_CONTACTLESS, CARD_LIMIT_ATM, CARD_LIMIT_DIPPING and
Expand Down Expand Up @@ -244,6 +252,13 @@ class Card extends BunqModel
*/
protected $cardLimitFieldForRequest;

/**
* The ATM spending limit for the card.
*
* @var Amount|null
*/
protected $cardLimitAtmFieldForRequest;

/**
* DEPRECATED: The limits to define for the card, among
* CARD_LIMIT_CONTACTLESS, CARD_LIMIT_ATM, CARD_LIMIT_DIPPING and
Expand Down Expand Up @@ -301,6 +316,7 @@ class Card extends BunqModel
* and DEACTIVATED) are permanent and cannot be changed
* after.
* @param Amount|null $cardLimit The spending limit for the card.
* @param Amount|null $cardLimitAtm The ATM 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
Expand All @@ -321,6 +337,7 @@ public function __construct(
string $activationCode = null,
string $status = null,
Amount $cardLimit = null,
Amount $cardLimitAtm = null,
array $limit = null,
CardMagStripePermission $magStripePermission = null,
array $countryPermission = null,
Expand All @@ -331,6 +348,7 @@ public function __construct(
$this->activationCodeFieldForRequest = $activationCode;
$this->statusFieldForRequest = $status;
$this->cardLimitFieldForRequest = $cardLimit;
$this->cardLimitAtmFieldForRequest = $cardLimitAtm;
$this->limitFieldForRequest = $limit;
$this->magStripePermissionFieldForRequest = $magStripePermission;
$this->countryPermissionFieldForRequest = $countryPermission;
Expand Down Expand Up @@ -362,6 +380,7 @@ public function __construct(
* and DEACTIVATED) are permanent and cannot be changed
* after.
* @param Amount|null $cardLimit The spending limit for the card.
* @param Amount|null $cardLimitAtm The ATM 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
Expand All @@ -386,6 +405,7 @@ public static function update(
string $activationCode = null,
string $status = null,
Amount $cardLimit = null,
Amount $cardLimitAtm = null,
array $limit = null,
CardMagStripePermission $magStripePermission = null,
array $countryPermission = null,
Expand All @@ -405,6 +425,7 @@ public static function update(
self::FIELD_ACTIVATION_CODE => $activationCode,
self::FIELD_STATUS => $status,
self::FIELD_CARD_LIMIT => $cardLimit,
self::FIELD_CARD_LIMIT_ATM => $cardLimitAtm,
self::FIELD_LIMIT => $limit,
self::FIELD_MAG_STRIPE_PERMISSION => $magStripePermission,
self::FIELD_COUNTRY_PERMISSION => $countryPermission,
Expand Down Expand Up @@ -749,7 +770,7 @@ public function setPrimaryAccountNumberFourDigit($primaryAccountNumberFourDigit)
}

/**
* The spending limit for the cards
* The spending limit for the card.
*
* @return Amount
*/
Expand All @@ -769,6 +790,27 @@ public function setCardLimit($cardLimit)
$this->cardLimit = $cardLimit;
}

/**
* The ATM spending limit for the card.
*
* @return Amount
*/
public function getCardLimitAtm()
{
return $this->cardLimitAtm;
}

/**
* @deprecated User should not be able to set values via setters, use
* constructor.
*
* @param Amount $cardLimitAtm
*/
public function setCardLimitAtm($cardLimitAtm)
{
$this->cardLimitAtm = $cardLimitAtm;
}

/**
* DEPRECATED: The limits to define for the card, among
* CARD_LIMIT_CONTACTLESS, CARD_LIMIT_ATM, CARD_LIMIT_DIPPING and
Expand Down Expand Up @@ -1004,6 +1046,10 @@ public function isAllFieldNull()
return false;
}

if (!is_null($this->cardLimitAtm)) {
return false;
}

if (!is_null($this->limit)) {
return false;
}
Expand Down
Loading

0 comments on commit 64c795e

Please sign in to comment.