Skip to content

Commit

Permalink
Release 2.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
schurter-wallee committed Dec 17, 2020
1 parent f05800b commit c240376
Show file tree
Hide file tree
Showing 56 changed files with 911 additions and 751 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "postfinancecheckout/sdk",
"version": "2.1.4",
"version": "2.1.5",
"description": "PostFinance Checkout SDK for PHP",
"keywords": [
"postfinancecheckout",
Expand Down
2 changes: 1 addition & 1 deletion lib/ApiClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ final class ApiClient {
*
* @var string
*/
private $userAgent = 'PHP-Client/2.1.4/php';
private $userAgent = 'PHP-Client/2.1.5/php';

/**
* The path to the certificate authority file.
Expand Down
6 changes: 3 additions & 3 deletions lib/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class Configuration
*
* @var string
*/
protected $userAgent = 'PostFinanceCheckout\Sdk/2.1.4/php';
protected $userAgent = 'PostFinanceCheckout\Sdk/2.1.5/php';

/**
* Debug switch (default set to false)
Expand Down Expand Up @@ -388,8 +388,8 @@ public static function toDebugReport()
$report = 'PHP SDK (PostFinanceCheckout\Sdk) Debug Report:' . PHP_EOL;
$report .= ' OS: ' . php_uname() . PHP_EOL;
$report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL;
$report .= ' OpenAPI Spec Version: 2.1.4' . PHP_EOL;
$report .= ' SDK Package Version: 2.1.4' . PHP_EOL;
$report .= ' OpenAPI Spec Version: 2.1.5' . PHP_EOL;
$report .= ' SDK Package Version: 2.1.5' . PHP_EOL;
$report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL;

return $report;
Expand Down
5 changes: 5 additions & 0 deletions lib/Http/SocketHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ private function readFromSocket(ApiClient $apiClient, HttpRequest $request, $soc
}
$responseMessage .= $line;
} else {
// If the content of the response is empty, there is nothing to be read.
if ($contentLength == 0) {
$endReached = true;
break;
}
// Check if we can read without chunks
if (!$chunked) {
$readBytes = 4096;
Expand Down
56 changes: 28 additions & 28 deletions lib/Model/AbstractPaymentLinkUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ class AbstractPaymentLinkUpdate implements ModelInterface, ArrayAccess
'applied_space_view' => 'int',
'available_from' => '\DateTime',
'available_until' => '\DateTime',
'billing_address_required' => 'bool',
'billing_address_handling_mode' => '\PostFinanceCheckout\Sdk\Model\PaymentLinkAddressHandlingMode',
'currency' => 'string',
'language' => 'string',
'line_items' => '\PostFinanceCheckout\Sdk\Model\LineItemCreate[]',
'maximal_number_of_transactions' => 'int',
'name' => 'string',
'shipping_address_required' => 'bool'
'shipping_address_handling_mode' => '\PostFinanceCheckout\Sdk\Model\PaymentLinkAddressHandlingMode'
];

/**
Expand All @@ -71,13 +71,13 @@ class AbstractPaymentLinkUpdate implements ModelInterface, ArrayAccess
'applied_space_view' => 'int64',
'available_from' => 'date-time',
'available_until' => 'date-time',
'billing_address_required' => null,
'billing_address_handling_mode' => null,
'currency' => null,
'language' => null,
'line_items' => null,
'maximal_number_of_transactions' => 'int32',
'name' => null,
'shipping_address_required' => null
'shipping_address_handling_mode' => null
];

/**
Expand All @@ -91,13 +91,13 @@ class AbstractPaymentLinkUpdate implements ModelInterface, ArrayAccess
'applied_space_view' => 'appliedSpaceView',
'available_from' => 'availableFrom',
'available_until' => 'availableUntil',
'billing_address_required' => 'billingAddressRequired',
'billing_address_handling_mode' => 'billingAddressHandlingMode',
'currency' => 'currency',
'language' => 'language',
'line_items' => 'lineItems',
'maximal_number_of_transactions' => 'maximalNumberOfTransactions',
'name' => 'name',
'shipping_address_required' => 'shippingAddressRequired'
'shipping_address_handling_mode' => 'shippingAddressHandlingMode'
];

/**
Expand All @@ -110,13 +110,13 @@ class AbstractPaymentLinkUpdate implements ModelInterface, ArrayAccess
'applied_space_view' => 'setAppliedSpaceView',
'available_from' => 'setAvailableFrom',
'available_until' => 'setAvailableUntil',
'billing_address_required' => 'setBillingAddressRequired',
'billing_address_handling_mode' => 'setBillingAddressHandlingMode',
'currency' => 'setCurrency',
'language' => 'setLanguage',
'line_items' => 'setLineItems',
'maximal_number_of_transactions' => 'setMaximalNumberOfTransactions',
'name' => 'setName',
'shipping_address_required' => 'setShippingAddressRequired'
'shipping_address_handling_mode' => 'setShippingAddressHandlingMode'
];

/**
Expand All @@ -129,13 +129,13 @@ class AbstractPaymentLinkUpdate implements ModelInterface, ArrayAccess
'applied_space_view' => 'getAppliedSpaceView',
'available_from' => 'getAvailableFrom',
'available_until' => 'getAvailableUntil',
'billing_address_required' => 'getBillingAddressRequired',
'billing_address_handling_mode' => 'getBillingAddressHandlingMode',
'currency' => 'getCurrency',
'language' => 'getLanguage',
'line_items' => 'getLineItems',
'maximal_number_of_transactions' => 'getMaximalNumberOfTransactions',
'name' => 'getName',
'shipping_address_required' => 'getShippingAddressRequired'
'shipping_address_handling_mode' => 'getShippingAddressHandlingMode'
];


Expand Down Expand Up @@ -164,7 +164,7 @@ public function __construct(array $data = null)

$this->container['available_until'] = isset($data['available_until']) ? $data['available_until'] : null;

$this->container['billing_address_required'] = isset($data['billing_address_required']) ? $data['billing_address_required'] : null;
$this->container['billing_address_handling_mode'] = isset($data['billing_address_handling_mode']) ? $data['billing_address_handling_mode'] : null;

$this->container['currency'] = isset($data['currency']) ? $data['currency'] : null;

Expand All @@ -176,7 +176,7 @@ public function __construct(array $data = null)

$this->container['name'] = isset($data['name']) ? $data['name'] : null;

$this->container['shipping_address_required'] = isset($data['shipping_address_required']) ? $data['shipping_address_required'] : null;
$this->container['shipping_address_handling_mode'] = isset($data['shipping_address_handling_mode']) ? $data['shipping_address_handling_mode'] : null;

}

Expand Down Expand Up @@ -374,25 +374,25 @@ public function setAvailableUntil($available_until)


/**
* Gets billing_address_required
* Gets billing_address_handling_mode
*
* @return bool
* @return \PostFinanceCheckout\Sdk\Model\PaymentLinkAddressHandlingMode
*/
public function getBillingAddressRequired()
public function getBillingAddressHandlingMode()
{
return $this->container['billing_address_required'];
return $this->container['billing_address_handling_mode'];
}

/**
* Sets billing_address_required
* Sets billing_address_handling_mode
*
* @param bool $billing_address_required By making the billing address required the transaction can only be created when a billing address is provided within the request.
* @param \PostFinanceCheckout\Sdk\Model\PaymentLinkAddressHandlingMode $billing_address_handling_mode The billing address handling mode controls if the address is collected or not and how it is collected.
*
* @return $this
*/
public function setBillingAddressRequired($billing_address_required)
public function setBillingAddressHandlingMode($billing_address_handling_mode)
{
$this->container['billing_address_required'] = $billing_address_required;
$this->container['billing_address_handling_mode'] = $billing_address_handling_mode;

return $this;
}
Expand Down Expand Up @@ -528,25 +528,25 @@ public function setName($name)


/**
* Gets shipping_address_required
* Gets shipping_address_handling_mode
*
* @return bool
* @return \PostFinanceCheckout\Sdk\Model\PaymentLinkAddressHandlingMode
*/
public function getShippingAddressRequired()
public function getShippingAddressHandlingMode()
{
return $this->container['shipping_address_required'];
return $this->container['shipping_address_handling_mode'];
}

/**
* Sets shipping_address_required
* Sets shipping_address_handling_mode
*
* @param bool $shipping_address_required By making the shipping address required the transaction can only be created when a shipping address is provided within the request.
* @param \PostFinanceCheckout\Sdk\Model\PaymentLinkAddressHandlingMode $shipping_address_handling_mode The shipping address handling mode controls if the address is collected or not and how it is collected.
*
* @return $this
*/
public function setShippingAddressRequired($shipping_address_required)
public function setShippingAddressHandlingMode($shipping_address_handling_mode)
{
$this->container['shipping_address_required'] = $shipping_address_required;
$this->container['shipping_address_handling_mode'] = $shipping_address_handling_mode;

return $this;
}
Expand Down
8 changes: 8 additions & 0 deletions lib/Model/AccountCreate.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ public function listInvalidProperties()
{
$invalidProperties = parent::listInvalidProperties();

if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) > 200)) {
$invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 200.";
}

if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) < 3)) {
$invalidProperties[] = "invalid value for 'name', the character length must be bigger than or equal to 3.";
}

if ($this->container['scope'] === null) {
$invalidProperties[] = "'scope' can't be null";
}
Expand Down
8 changes: 8 additions & 0 deletions lib/Model/AccountUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ public function listInvalidProperties()
{
$invalidProperties = parent::listInvalidProperties();

if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) > 200)) {
$invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 200.";
}

if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) < 3)) {
$invalidProperties[] = "invalid value for 'name', the character length must be bigger than or equal to 3.";
}

if ($this->container['id'] === null) {
$invalidProperties[] = "'id' can't be null";
}
Expand Down
42 changes: 5 additions & 37 deletions lib/Model/ApplicationUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ class ApplicationUser extends User
protected static $swaggerTypes = [
'name' => 'string',
'primary_account' => '\PostFinanceCheckout\Sdk\Model\Account',
'request_limit' => 'int',
'scope' => '\PostFinanceCheckout\Sdk\Model\Scope'
'request_limit' => 'int'
];

/**
Expand All @@ -61,8 +60,7 @@ class ApplicationUser extends User
protected static $swaggerFormats = [
'name' => null,
'primary_account' => null,
'request_limit' => 'int64',
'scope' => null
'request_limit' => 'int64'
];

/**
Expand All @@ -74,8 +72,7 @@ class ApplicationUser extends User
protected static $attributeMap = [
'name' => 'name',
'primary_account' => 'primaryAccount',
'request_limit' => 'requestLimit',
'scope' => 'scope'
'request_limit' => 'requestLimit'
];

/**
Expand All @@ -86,8 +83,7 @@ class ApplicationUser extends User
protected static $setters = [
'name' => 'setName',
'primary_account' => 'setPrimaryAccount',
'request_limit' => 'setRequestLimit',
'scope' => 'setScope'
'request_limit' => 'setRequestLimit'
];

/**
Expand All @@ -98,8 +94,7 @@ class ApplicationUser extends User
protected static $getters = [
'name' => 'getName',
'primary_account' => 'getPrimaryAccount',
'request_limit' => 'getRequestLimit',
'scope' => 'getScope'
'request_limit' => 'getRequestLimit'
];


Expand All @@ -122,8 +117,6 @@ public function __construct(array $data = null)

$this->container['request_limit'] = isset($data['request_limit']) ? $data['request_limit'] : null;

$this->container['scope'] = isset($data['scope']) ? $data['scope'] : null;

}

/**
Expand Down Expand Up @@ -297,31 +290,6 @@ public function setRequestLimit($request_limit)
return $this;
}


/**
* Gets scope
*
* @return \PostFinanceCheckout\Sdk\Model\Scope
*/
public function getScope()
{
return $this->container['scope'];
}

/**
* Sets scope
*
* @param \PostFinanceCheckout\Sdk\Model\Scope $scope The scope to which the user belongs to.
*
* @return $this
*/
public function setScope($scope)
{
$this->container['scope'] = $scope;

return $this;
}

/**
* Returns true if offset exists. False otherwise.
*
Expand Down
4 changes: 4 additions & 0 deletions lib/Model/ApplicationUserCreate.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ public function listInvalidProperties()
{
$invalidProperties = parent::listInvalidProperties();

if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) > 256)) {
$invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 256.";
}

if ($this->container['primary_account'] === null) {
$invalidProperties[] = "'primary_account' can't be null";
}
Expand Down
4 changes: 4 additions & 0 deletions lib/Model/ApplicationUserCreateWithMacKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ public function listInvalidProperties()
{
$invalidProperties = parent::listInvalidProperties();

if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) > 256)) {
$invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 256.";
}

return $invalidProperties;
}

Expand Down
4 changes: 4 additions & 0 deletions lib/Model/ApplicationUserUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ public function listInvalidProperties()
{
$invalidProperties = parent::listInvalidProperties();

if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) > 256)) {
$invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 256.";
}

if ($this->container['id'] === null) {
$invalidProperties[] = "'id' can't be null";
}
Expand Down
Loading

0 comments on commit c240376

Please sign in to comment.