Skip to content

Commit

Permalink
Release 4.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wallee-deployment-user committed Aug 14, 2024
1 parent 1fed3c3 commit 413abf6
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 8 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wallee/sdk",
"version": "4.4.0",
"version": "4.5.0",
"description": "wallee SDK for PHP",
"keywords": [
"wallee",
Expand Down
4 changes: 2 additions & 2 deletions lib/ApiClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ final class ApiClient {
* @var array
*/
private $defaultHeaders = [
'x-meta-sdk-version' => "4.4.0",
'x-meta-sdk-version' => "4.5.0",
'x-meta-sdk-language' => 'php',
'x-meta-sdk-provider' => "wallee",
];
Expand All @@ -58,7 +58,7 @@ final class ApiClient {
*
* @var string
*/
private $userAgent = 'PHP-Client/4.4.0/php';
private $userAgent = 'PHP-Client/4.5.0/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 = 'Wallee\Sdk/4.4.0/php';
protected $userAgent = 'Wallee\Sdk/4.5.0/php';

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

return $report;
Expand Down
7 changes: 6 additions & 1 deletion lib/Http/CurlHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,12 @@ public function send(ApiClient $apiClient, HttpRequest $request): HttpResponse {
* @return HttpResponse
* @throws ConnectionException
*/
private function handleResponse(ApiClient $apiClient, HttpRequest $request, \CurlHandle $curl, string|bool $curlResponse, string $url): HttpResponse {
private function handleResponse(ApiClient $apiClient, HttpRequest $request, $curl, $curlResponse, string $url): HttpResponse {
// Remove this check once PHP 7.4 is not supported anymore and this can be set in the arguments:
if (!is_string($curlResponse) && !is_bool($curlResponse)) {
throw new ConnectionException($url, $request->getLogToken(), "API call response was not bool or string.");
}

$httpHeaderSize = curl_getinfo($curl, CURLINFO_HEADER_SIZE);

// Handle the case where $curlResponse is false (indicating an error)
Expand Down
32 changes: 32 additions & 0 deletions lib/Model/SubscriptionLedgerEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class SubscriptionLedgerEntry implements ModelInterface, ArrayAccess
'id' => 'int',
'linked_space_id' => 'int',
'planned_purge_date' => '\DateTime',
'pro_rata_calculated' => 'bool',
'quantity' => 'float',
'state' => '\Wallee\Sdk\Model\SubscriptionLedgerEntryState',
'subscription_version' => 'int',
Expand All @@ -84,6 +85,7 @@ class SubscriptionLedgerEntry implements ModelInterface, ArrayAccess
'id' => 'int64',
'linked_space_id' => 'int64',
'planned_purge_date' => 'date-time',
'pro_rata_calculated' => null,
'quantity' => null,
'state' => null,
'subscription_version' => 'int64',
Expand All @@ -110,6 +112,7 @@ class SubscriptionLedgerEntry implements ModelInterface, ArrayAccess
'id' => 'id',
'linked_space_id' => 'linkedSpaceId',
'planned_purge_date' => 'plannedPurgeDate',
'pro_rata_calculated' => 'proRataCalculated',
'quantity' => 'quantity',
'state' => 'state',
'subscription_version' => 'subscriptionVersion',
Expand All @@ -135,6 +138,7 @@ class SubscriptionLedgerEntry implements ModelInterface, ArrayAccess
'id' => 'setId',
'linked_space_id' => 'setLinkedSpaceId',
'planned_purge_date' => 'setPlannedPurgeDate',
'pro_rata_calculated' => 'setProRataCalculated',
'quantity' => 'setQuantity',
'state' => 'setState',
'subscription_version' => 'setSubscriptionVersion',
Expand All @@ -160,6 +164,7 @@ class SubscriptionLedgerEntry implements ModelInterface, ArrayAccess
'id' => 'getId',
'linked_space_id' => 'getLinkedSpaceId',
'planned_purge_date' => 'getPlannedPurgeDate',
'pro_rata_calculated' => 'getProRataCalculated',
'quantity' => 'getQuantity',
'state' => 'getState',
'subscription_version' => 'getSubscriptionVersion',
Expand Down Expand Up @@ -207,6 +212,8 @@ public function __construct(array $data = null)

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

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

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

$this->container['state'] = isset($data['state']) ? $data['state'] : null;
Expand Down Expand Up @@ -570,6 +577,31 @@ public function setPlannedPurgeDate($planned_purge_date)
}


/**
* Gets pro_rata_calculated
*
* @return bool
*/
public function getProRataCalculated()
{
return $this->container['pro_rata_calculated'];
}

/**
* Sets pro_rata_calculated
*
* @param bool $pro_rata_calculated
*
* @return $this
*/
public function setProRataCalculated($pro_rata_calculated)
{
$this->container['pro_rata_calculated'] = $pro_rata_calculated;

return $this;
}


/**
* Gets quantity
*
Expand Down
2 changes: 1 addition & 1 deletion test/ApiClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function testSdkHeaders()
$this->assertGreaterThanOrEqual(4, count($headers));

// Check SDK default header values.
$this->assertEquals($headers['x-meta-sdk-version'], "4.4.0");
$this->assertEquals($headers['x-meta-sdk-version'], "4.5.0");
$this->assertEquals($headers['x-meta-sdk-language'], 'php');
$this->assertEquals($headers['x-meta-sdk-provider'], "wallee");
$this->assertEquals($headers['x-meta-sdk-language-version'], phpversion());
Expand Down

0 comments on commit 413abf6

Please sign in to comment.