From 07d1d657aa84a99a80d12c9f4f5b073884806702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksander=20K=C4=85kol?= Date: Fri, 13 Feb 2026 09:17:04 +0100 Subject: [PATCH 1/4] Update SDK version on release --- .github/workflows/create_release.yaml | 4 ++++ src/Api/ApiAction.php | 5 ++++- src/SdkVersion.php | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 src/SdkVersion.php diff --git a/.github/workflows/create_release.yaml b/.github/workflows/create_release.yaml index 432af92..6af6386 100644 --- a/.github/workflows/create_release.yaml +++ b/.github/workflows/create_release.yaml @@ -14,6 +14,10 @@ jobs: - name: Checkout source uses: actions/checkout@v3 + - name: Inject version into SdkVersion.php + run: | + sed -i "s/const VERSION = '.*';/const VERSION = '${{ github.event.inputs.version }}';/" src/SdkVersion.php + - uses: shivammathur/setup-php@v2 with: php-version: 7.1 diff --git a/src/Api/ApiAction.php b/src/Api/ApiAction.php index 75e8402..9f4b850 100644 --- a/src/Api/ApiAction.php +++ b/src/Api/ApiAction.php @@ -7,6 +7,7 @@ use Tpay\OpenApi\Dictionary\HttpCodesDictionary; use Tpay\OpenApi\Manager\Manager; use Tpay\OpenApi\Model\Objects\Authorization\Token; +use Tpay\OpenApi\SdkVersion; use Tpay\OpenApi\Utilities\Logger; use Tpay\OpenApi\Utilities\TpayException; @@ -39,7 +40,9 @@ public function __construct(Token $Token, bool $productionMode) $this->Token = $Token; $this->Curl = new Curl(); $this->Manager = new Manager(); - $this->clientName = 'tpay-com/tpay-openapi-php:2.3.0|PHP:'.phpversion(); + $this->clientName = + 'tpay-com/tpay-openapi-php:'.SdkVersion::VERSION. + '|PHP:'.phpversion(); $this->apiUrl = true === $this->productionMode ? ApiAction::TPAY_API_URL_PRODUCTION : ApiAction::TPAY_API_URL_SANDBOX; diff --git a/src/SdkVersion.php b/src/SdkVersion.php new file mode 100644 index 0000000..667fdc2 --- /dev/null +++ b/src/SdkVersion.php @@ -0,0 +1,8 @@ + Date: Fri, 13 Feb 2026 09:18:24 +0100 Subject: [PATCH 2/4] fixer --- src/Api/ApiAction.php | 6 +++--- src/SdkVersion.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Api/ApiAction.php b/src/Api/ApiAction.php index 9f4b850..85916c7 100644 --- a/src/Api/ApiAction.php +++ b/src/Api/ApiAction.php @@ -40,9 +40,9 @@ public function __construct(Token $Token, bool $productionMode) $this->Token = $Token; $this->Curl = new Curl(); $this->Manager = new Manager(); - $this->clientName = - 'tpay-com/tpay-openapi-php:'.SdkVersion::VERSION. - '|PHP:'.phpversion(); + $this->clientName + = 'tpay-com/tpay-openapi-php:'.SdkVersion::VERSION + .'|PHP:'.phpversion(); $this->apiUrl = true === $this->productionMode ? ApiAction::TPAY_API_URL_PRODUCTION : ApiAction::TPAY_API_URL_SANDBOX; diff --git a/src/SdkVersion.php b/src/SdkVersion.php index 667fdc2..fa38c92 100644 --- a/src/SdkVersion.php +++ b/src/SdkVersion.php @@ -5,4 +5,4 @@ final class SdkVersion { const VERSION = '2.3.0'; -} \ No newline at end of file +} From ad578ff8733038b9fdef6efa4d2c6cdf2071cd6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksander=20K=C4=85kol?= Date: Fri, 13 Feb 2026 09:19:22 +0100 Subject: [PATCH 3/4] fixer --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 5dd7fcf..b41ecd1 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "require-dev": { "ext-openssl": "*", "php-parallel-lint/php-parallel-lint": "^1.3.2", - "phpunit/phpunit": "^5.7.27 || ^9.6.10", + "phpunit/phpunit": "^5.7 || ^7.5 || ^8.5 || ^9.5", "psx/cache": "^v1.0.2" }, "autoload": { From 950022e28a130d78c0d5facfb65777c3417efe74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksander=20K=C4=85kol?= Date: Fri, 13 Feb 2026 12:27:29 +0100 Subject: [PATCH 4/4] fixer --- .github/workflows/create_release.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create_release.yaml b/.github/workflows/create_release.yaml index 6af6386..5be1083 100644 --- a/.github/workflows/create_release.yaml +++ b/.github/workflows/create_release.yaml @@ -14,9 +14,8 @@ jobs: - name: Checkout source uses: actions/checkout@v3 - - name: Inject version into SdkVersion.php - run: | - sed -i "s/const VERSION = '.*';/const VERSION = '${{ github.event.inputs.version }}';/" src/SdkVersion.php + - name: Check version + run: if [ $(grep ${{ github.event.inputs.version }} src/SdkVersion.php -c) != 1 ]; then exit 1; fi - uses: shivammathur/setup-php@v2 with: