From 2e51e2fb174781ff52f6d5e6cd61ff7081294b5e Mon Sep 17 00:00:00 2001 From: Drew Rowan Date: Thu, 15 Aug 2024 10:57:44 +0200 Subject: [PATCH] Release 3.0.10 --- .github/workflows/woo-publish.yml | 7 ++++++- README.md | 4 ++-- changelog.txt | 7 +++++++ docs/en/documentation.html | 2 +- ...-wc-postfinancecheckout-admin-settings-page.php | 2 +- .../class-wc-postfinancecheckout-migration.php | 2 +- postfinancecheckout-sdk/composer.json | 2 +- postfinancecheckout-sdk/lib/ApiClient.php | 4 ++-- postfinancecheckout-sdk/lib/Configuration.php | 6 +++--- .../lib/Http/CurlHttpClient.php | 7 ++++++- .../lib/Service/ChargeFlowService.php | 2 +- .../lib/Service/HumanUserService.php | 2 +- .../lib/Service/TransactionIframeService.php | 2 +- .../lib/Service/TransactionLightboxService.php | 2 +- .../lib/Service/TransactionMobileSdkService.php | 2 +- .../lib/Service/TransactionPaymentPageService.php | 2 +- .../lib/Service/TransactionService.php | 2 +- postfinancecheckout-sdk/test/ApiClientTest.php | 2 +- readme.txt | 14 +++++++------- woocommerce-postfinancecheckout.php | 6 +++--- 20 files changed, 48 insertions(+), 31 deletions(-) diff --git a/.github/workflows/woo-publish.yml b/.github/workflows/woo-publish.yml index 1a90fcc..46e9088 100644 --- a/.github/workflows/woo-publish.yml +++ b/.github/workflows/woo-publish.yml @@ -1,5 +1,5 @@ name: Release Plugin -on: +on: push: tags: - '*' @@ -18,7 +18,10 @@ jobs: WHITELABEL: ${{ vars.WHITELABEL_NAME }} FAQ_ENTRIES: ${{ vars.FAQ_ENTRIES }} FEATURES: ${{ vars.FEATURES }} + # sleep 90 is required, because gradle release command takes around 65s, we should start upload zip file after it finishes + # zip file is attached when pipeline is finished run: | + sleep 90 echo $GITHUB_WORKSPACE echo $WORDPRESS_ORG_SLUG ls -ltrh @@ -58,6 +61,8 @@ jobs: - name: WordPress Plugin Deploy id: deploy + # does not deploy if it's testing repo + if: ${{ vars.WORDPRESS_ORG_SLUG != 'woo-WhiteLabelGithubOwnerName' }} uses: 10up/action-wordpress-plugin-deploy@stable with: generate-zip: true diff --git a/README.md b/README.md index 07cd637..04d17e8 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ This repository contains the PostFinance Checkout plugin that enables WooCommerc ## Documentation -* [Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.0.9/docs/en/documentation.html) +* [Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.0.10/docs/en/documentation.html) ## Support @@ -33,4 +33,4 @@ ____________________________________________________________________________ ## License -Please see the [license file](https://github.com/pfpayments/woocommerce/blob/3.0.9/LICENSE) for more information. +Please see the [license file](https://github.com/pfpayments/woocommerce/blob/3.0.10/LICENSE) for more information. diff --git a/changelog.txt b/changelog.txt index 5605afb..a90f56a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -790,3 +790,10 @@ Tested against: - [Tested Against] Woocommerce 9.1.2 - [Tested Against] PHP SDK 4.4.0 += 3.0.10 - Aug 14 2024 = +- [Bugfix] Fixed syntax issues with older php versions (7.4) +- [Tested Against] PHP 8.0 and PHP 7.4 +- [Tested Against] Wordpress 6.6 +- [Tested Against] Woocommerce 9.1.4 +- [Tested Against] PHP SDK 4.5.0 + diff --git a/docs/en/documentation.html b/docs/en/documentation.html index 43ccf93..f8b74fd 100644 --- a/docs/en/documentation.html +++ b/docs/en/documentation.html @@ -23,7 +23,7 @@

Documentation

  • - + Source
  • diff --git a/includes/admin/class-wc-postfinancecheckout-admin-settings-page.php b/includes/admin/class-wc-postfinancecheckout-admin-settings-page.php index 9d924d8..856e0b1 100644 --- a/includes/admin/class-wc-postfinancecheckout-admin-settings-page.php +++ b/includes/admin/class-wc-postfinancecheckout-admin-settings-page.php @@ -187,7 +187,7 @@ public function get_settings() { $settings = array( array( 'links' => array( - 'https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.0.9/docs/en/documentation.html' => __( 'Documentation', 'woo-postfinancecheckout' ), + 'https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.0.10/docs/en/documentation.html' => __( 'Documentation', 'woo-postfinancecheckout' ), 'https://checkout.postfinance.ch/en-ch/user/signup' => __( 'Sign Up', 'woo-postfinancecheckout' ), ), 'type' => 'postfinancecheckout_links', diff --git a/includes/class-wc-postfinancecheckout-migration.php b/includes/class-wc-postfinancecheckout-migration.php index 5187c08..7ed9963 100644 --- a/includes/class-wc-postfinancecheckout-migration.php +++ b/includes/class-wc-postfinancecheckout-migration.php @@ -249,7 +249,7 @@ public static function check_version() { public static function plugin_row_meta( $links, $file ) { if ( WC_POSTFINANCECHECKOUT_PLUGIN_BASENAME === $file ) { $row_meta = array( - 'docs' => '' . esc_html__( 'Documentation', 'woo-postfinancecheckout' ) . '', + 'docs' => '' . esc_html__( 'Documentation', 'woo-postfinancecheckout' ) . '', ); return array_merge( $links, $row_meta ); diff --git a/postfinancecheckout-sdk/composer.json b/postfinancecheckout-sdk/composer.json index 4b001fc..7c64f5b 100644 --- a/postfinancecheckout-sdk/composer.json +++ b/postfinancecheckout-sdk/composer.json @@ -1,6 +1,6 @@ { "name": "postfinancecheckout/sdk", - "version": "4.4.0", + "version": "4.5.0", "description": "PostFinance Checkout SDK for PHP", "keywords": [ "postfinancecheckout", diff --git a/postfinancecheckout-sdk/lib/ApiClient.php b/postfinancecheckout-sdk/lib/ApiClient.php index 5a66192..9d91bc7 100644 --- a/postfinancecheckout-sdk/lib/ApiClient.php +++ b/postfinancecheckout-sdk/lib/ApiClient.php @@ -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", ]; @@ -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. diff --git a/postfinancecheckout-sdk/lib/Configuration.php b/postfinancecheckout-sdk/lib/Configuration.php index e4d3823..68a2f94 100644 --- a/postfinancecheckout-sdk/lib/Configuration.php +++ b/postfinancecheckout-sdk/lib/Configuration.php @@ -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) @@ -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; diff --git a/postfinancecheckout-sdk/lib/Http/CurlHttpClient.php b/postfinancecheckout-sdk/lib/Http/CurlHttpClient.php index 5c8ec92..4cc8bb1 100644 --- a/postfinancecheckout-sdk/lib/Http/CurlHttpClient.php +++ b/postfinancecheckout-sdk/lib/Http/CurlHttpClient.php @@ -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) diff --git a/postfinancecheckout-sdk/lib/Service/ChargeFlowService.php b/postfinancecheckout-sdk/lib/Service/ChargeFlowService.php index a2179c7..9351233 100644 --- a/postfinancecheckout-sdk/lib/Service/ChargeFlowService.php +++ b/postfinancecheckout-sdk/lib/Service/ChargeFlowService.php @@ -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; } diff --git a/postfinancecheckout-sdk/lib/Service/HumanUserService.php b/postfinancecheckout-sdk/lib/Service/HumanUserService.php index f337312..f0f0f6b 100644 --- a/postfinancecheckout-sdk/lib/Service/HumanUserService.php +++ b/postfinancecheckout-sdk/lib/Service/HumanUserService.php @@ -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; } diff --git a/postfinancecheckout-sdk/lib/Service/TransactionIframeService.php b/postfinancecheckout-sdk/lib/Service/TransactionIframeService.php index 0d993ef..eeac1c0 100644 --- a/postfinancecheckout-sdk/lib/Service/TransactionIframeService.php +++ b/postfinancecheckout-sdk/lib/Service/TransactionIframeService.php @@ -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; } diff --git a/postfinancecheckout-sdk/lib/Service/TransactionLightboxService.php b/postfinancecheckout-sdk/lib/Service/TransactionLightboxService.php index 80bc5f4..38a2806 100644 --- a/postfinancecheckout-sdk/lib/Service/TransactionLightboxService.php +++ b/postfinancecheckout-sdk/lib/Service/TransactionLightboxService.php @@ -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; } diff --git a/postfinancecheckout-sdk/lib/Service/TransactionMobileSdkService.php b/postfinancecheckout-sdk/lib/Service/TransactionMobileSdkService.php index e60e355..f7dd2e5 100644 --- a/postfinancecheckout-sdk/lib/Service/TransactionMobileSdkService.php +++ b/postfinancecheckout-sdk/lib/Service/TransactionMobileSdkService.php @@ -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; } diff --git a/postfinancecheckout-sdk/lib/Service/TransactionPaymentPageService.php b/postfinancecheckout-sdk/lib/Service/TransactionPaymentPageService.php index 3654a22..dcdac7d 100644 --- a/postfinancecheckout-sdk/lib/Service/TransactionPaymentPageService.php +++ b/postfinancecheckout-sdk/lib/Service/TransactionPaymentPageService.php @@ -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; } diff --git a/postfinancecheckout-sdk/lib/Service/TransactionService.php b/postfinancecheckout-sdk/lib/Service/TransactionService.php index 087f54c..b98b4c1 100644 --- a/postfinancecheckout-sdk/lib/Service/TransactionService.php +++ b/postfinancecheckout-sdk/lib/Service/TransactionService.php @@ -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; } diff --git a/postfinancecheckout-sdk/test/ApiClientTest.php b/postfinancecheckout-sdk/test/ApiClientTest.php index 7e32a44..184ba75 100644 --- a/postfinancecheckout-sdk/test/ApiClientTest.php +++ b/postfinancecheckout-sdk/test/ApiClientTest.php @@ -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()); diff --git a/readme.txt b/readme.txt index 4538feb..77e7388 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: postfinancecheckout AG Tags: woocommerce PostFinance Checkout, woocommerce, PostFinance Checkout, payment, e-commerce, webshop, psp, invoice, packing slips, pdf, customer invoice, processing Requires at least: 4.7 Tested up to: 6.5 -Stable tag: 3.0.9 +Stable tag: 3.0.10 License: Apache 2 License URI: http://www.apache.org/licenses/LICENSE-2.0 @@ -23,7 +23,7 @@ To use this extension, a PostFinance Checkout account is required. Sign up on [P == Documentation == -Additional documentation for this plugin is available [here](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.0.9/docs/en/documentation.html). +Additional documentation for this plugin is available [here](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.0.10/docs/en/documentation.html). == Support == @@ -58,9 +58,9 @@ Support queries can be issued on the [PostFinance Checkout support site](https:/ == Changelog == -= 3.0.9 - Jul 22 2024 = -- [Bugfix] If payment fails, go back to checkout page. -- [Tested Against] PHP 8.0 += 3.0.10 - Aug 14 2024 = +- [Bugfix] Fixed syntax issues with older php versions (7.4) +- [Tested Against] PHP 8.0 and PHP 7.4 - [Tested Against] Wordpress 6.6 -- [Tested Against] Woocommerce 9.1.2 -- [Tested Against] PHP SDK 4.4.0 +- [Tested Against] Woocommerce 9.1.4 +- [Tested Against] PHP SDK 4.5.0 diff --git a/woocommerce-postfinancecheckout.php b/woocommerce-postfinancecheckout.php index 3bc3e92..52fce16 100644 --- a/woocommerce-postfinancecheckout.php +++ b/woocommerce-postfinancecheckout.php @@ -4,7 +4,7 @@ * Plugin URI: https://wordpress.org/plugins/woo-postfinancecheckout * Description: Process WooCommerce payments with PostFinance Checkout. * License: Apache2 - * Version: 3.0.9 + * Version: 3.0.10 * License URI: http://www.apache.org/licenses/LICENSE-2.0 * Author: postfinancecheckout AG * Author URI: https://postfinance.ch/en/business/products/e-commerce/postfinance-checkout-all-in-one.html @@ -39,14 +39,14 @@ final class WooCommerce_PostFinanceCheckout { const CK_INTEGRATION = 'wc_postfinancecheckout_integration'; const CK_ORDER_REFERENCE = 'wc_postfinancecheckout_order_reference'; const CK_ENFORCE_CONSISTENCY = 'wc_postfinancecheckout_enforce_consistency'; - const WC_MAXIMUM_VERSION = '9.1.2'; + const WC_MAXIMUM_VERSION = '9.1.4'; /** * WooCommerce PostFinanceCheckout version. * * @var string */ - private $version = '3.0.9'; + private $version = '3.0.10'; /** * The single instance of the class.