diff --git a/.github/workflows/create_release.yaml b/.github/workflows/create_release.yaml index 432af92..5be1083 100644 --- a/.github/workflows/create_release.yaml +++ b/.github/workflows/create_release.yaml @@ -14,6 +14,9 @@ jobs: - name: Checkout source uses: actions/checkout@v3 + - 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: php-version: 7.1 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": { diff --git a/src/Api/ApiAction.php b/src/Api/ApiAction.php index 75e8402..85916c7 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..fa38c92 --- /dev/null +++ b/src/SdkVersion.php @@ -0,0 +1,8 @@ +