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 c7078f0 commit 938e0e1
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 15 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": "4.4.0",
"version": "4.5.0",
"description": "PostFinance Checkout SDK for PHP",
"keywords": [
"postfinancecheckout",
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' => "PostFinance Checkout",
];
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 = 'PostFinanceCheckout\Sdk/4.4.0/php';
protected $userAgent = 'PostFinanceCheckout\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 (PostFinanceCheckout\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
2 changes: 1 addition & 1 deletion lib/Service/ChargeFlowService.php
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ public function fetchChargeFlowPaymentPageUrlWithHttpInfo($space_id, $id) {
}
// header params
$headerParams = [];
$headerAccept = $this->apiClient->selectHeaderAccept(['text/plain;charset=utf-8', 'application/json']);
$headerAccept = $this->apiClient->selectHeaderAccept(['application/json', 'text/plain;charset=utf-8']);
if (!is_null($headerAccept)) {
$headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/HumanUserService.php
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ public function exportWithHttpInfo($request) {
}
// header params
$headerParams = [];
$headerAccept = $this->apiClient->selectHeaderAccept(['text/csv', 'application/json;charset=utf-8']);
$headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8', 'text/csv']);
if (!is_null($headerAccept)) {
$headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/TransactionIframeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function javascriptUrlWithHttpInfo($space_id, $id) {
}
// header params
$headerParams = [];
$headerAccept = $this->apiClient->selectHeaderAccept(['text/plain;charset=utf-8', 'application/json']);
$headerAccept = $this->apiClient->selectHeaderAccept(['application/json', 'text/plain;charset=utf-8']);
if (!is_null($headerAccept)) {
$headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/TransactionLightboxService.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function javascriptUrlWithHttpInfo($space_id, $id) {
}
// header params
$headerParams = [];
$headerAccept = $this->apiClient->selectHeaderAccept(['text/plain;charset=utf-8', 'application/json']);
$headerAccept = $this->apiClient->selectHeaderAccept(['application/json', 'text/plain;charset=utf-8']);
if (!is_null($headerAccept)) {
$headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/TransactionMobileSdkService.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function paymentFormUrlWithHttpInfo($credentials) {
}
// header params
$headerParams = [];
$headerAccept = $this->apiClient->selectHeaderAccept(['text/plain;charset=utf-8', 'application/json']);
$headerAccept = $this->apiClient->selectHeaderAccept(['application/json', 'text/plain;charset=utf-8']);
if (!is_null($headerAccept)) {
$headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/TransactionPaymentPageService.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function paymentPageUrlWithHttpInfo($space_id, $id) {
}
// header params
$headerParams = [];
$headerAccept = $this->apiClient->selectHeaderAccept(['text/plain;charset=utf-8', 'application/json']);
$headerAccept = $this->apiClient->selectHeaderAccept(['application/json', 'text/plain;charset=utf-8']);
if (!is_null($headerAccept)) {
$headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/TransactionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ public function exportWithHttpInfo($space_id, $request) {
}
// header params
$headerParams = [];
$headerAccept = $this->apiClient->selectHeaderAccept(['text/csv', 'application/json;charset=utf-8']);
$headerAccept = $this->apiClient->selectHeaderAccept(['application/json;charset=utf-8', 'text/csv']);
if (!is_null($headerAccept)) {
$headerParams[HttpRequest::HEADER_KEY_ACCEPT] = $headerAccept;
}
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'], "PostFinance Checkout");
$this->assertEquals($headers['x-meta-sdk-language-version'], phpversion());
Expand Down

0 comments on commit 938e0e1

Please sign in to comment.