From cfda8f84773ce9cc1080709968a91bd49ca331da Mon Sep 17 00:00:00 2001 From: Antonio Buedo Date: Tue, 5 Nov 2019 11:52:12 +0100 Subject: [PATCH] #v3.2.1911.0-rc - Php required version lowered (#26) * - Invoice model update * - PHP supported versions 7.1 upwards *- Added Travis CI file --- .travis.yml | 5 + composer.json | 6 +- composer.lock | 179 +++++++----------- src/BitPaySDK/Client.php | 4 +- src/BitPaySDK/Env.php | 2 +- src/BitPaySDK/Model/Invoice/InvoiceStatus.php | 12 +- src/BitPaySDK/Model/Invoice/Refund.php | 10 +- tests/BitPaySDK/BitPayTest.php | 2 +- 8 files changed, 89 insertions(+), 131 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..35712894 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +language: php +php: + - 7.1 + - 7.2 + - 7.3 \ No newline at end of file diff --git a/composer.json b/composer.json index cc104040..c5386244 100644 --- a/composer.json +++ b/composer.json @@ -13,9 +13,9 @@ "homepage": "https://github.com/bitpay/php-bitpay-client-v2", "require": { "bitpay/key-utils": "^1.0", - "php": "^7.3", + "php": "^7.1", "guzzlehttp/guzzle": "^6.3", - "ext-json": "^1.7", + "ext-json": "^1.5", "ext-reflection": "*", "symfony/yaml": "^4.3" }, @@ -26,7 +26,7 @@ } ], "require-dev": { - "phpunit/phpunit": "^8.3" + "phpunit/phpunit": "^7.5" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 3a021498..7adcbbf3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "4d81feb158a59e0107dea94d5dc2a486", + "content-hash": "7a5d225017cd9ff41bdd25ed63a20a77", "packages": [ { "name": "bitpay/key-utils", @@ -49,27 +49,28 @@ }, { "name": "guzzlehttp/guzzle", - "version": "6.3.3", + "version": "6.4.1", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" + "reference": "0895c932405407fd3a7368b6910c09a24d26db11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", - "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/0895c932405407fd3a7368b6910c09a24d26db11", + "reference": "0895c932405407fd3a7368b6910c09a24d26db11", "shasum": "" }, "require": { + "ext-json": "*", "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.4", + "guzzlehttp/psr7": "^1.6.1", "php": ">=5.5" }, "require-dev": { "ext-curl": "*", "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", - "psr/log": "^1.0" + "psr/log": "^1.1" }, "suggest": { "psr/log": "Required for using the Log middleware" @@ -81,12 +82,12 @@ } }, "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { "GuzzleHttp\\": "src/" - } + }, + "files": [ + "src/functions_include.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -110,7 +111,7 @@ "rest", "web service" ], - "time": "2018-04-22T15:46:56+00:00" + "time": "2019-10-23T15:58:00+00:00" }, { "name": "guzzlehttp/promises", @@ -384,16 +385,16 @@ }, { "name": "symfony/yaml", - "version": "v4.3.5", + "version": "v4.3.6", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "41e16350a2a1c7383c4735aa2f9fce74cf3d1178" + "reference": "324cf4b19c345465fad14f3602050519e09e361d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/41e16350a2a1c7383c4735aa2f9fce74cf3d1178", - "reference": "41e16350a2a1c7383c4735aa2f9fce74cf3d1178", + "url": "https://api.github.com/repos/symfony/yaml/zipball/324cf4b19c345465fad14f3602050519e09e361d", + "reference": "324cf4b19c345465fad14f3602050519e09e361d", "shasum": "" }, "require": { @@ -439,7 +440,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-09-11T15:41:19+00:00" + "time": "2019-10-30T12:58:49+00:00" } ], "packages-dev": [ @@ -864,40 +865,40 @@ }, { "name": "phpunit/php-code-coverage", - "version": "7.0.8", + "version": "6.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "aa0d179a13284c7420fc281fc32750e6cc7c9e2f" + "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/aa0d179a13284c7420fc281fc32750e6cc7c9e2f", - "reference": "aa0d179a13284c7420fc281fc32750e6cc7c9e2f", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", + "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^7.2", - "phpunit/php-file-iterator": "^2.0.2", + "php": "^7.1", + "phpunit/php-file-iterator": "^2.0", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.1.1", + "phpunit/php-token-stream": "^3.0", "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^4.2.2", + "sebastian/environment": "^3.1 || ^4.0", "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1.3" + "theseer/tokenizer": "^1.1" }, "require-dev": { - "phpunit/phpunit": "^8.2.2" + "phpunit/phpunit": "^7.0" }, "suggest": { - "ext-xdebug": "^2.7.2" + "ext-xdebug": "^2.6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "7.0-dev" + "dev-master": "6.1-dev" } }, "autoload": { @@ -923,7 +924,7 @@ "testing", "xunit" ], - "time": "2019-09-17T06:24:36+00:00" + "time": "2018-10-31T16:06:48+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1116,52 +1117,53 @@ }, { "name": "phpunit/phpunit", - "version": "8.4.1", + "version": "7.5.17", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "366a4a0f2b971fd43b7c351d621e8dd7d7131869" + "reference": "4c92a15296e58191a4cd74cff3b34fc8e374174a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/366a4a0f2b971fd43b7c351d621e8dd7d7131869", - "reference": "366a4a0f2b971fd43b7c351d621e8dd7d7131869", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4c92a15296e58191a4cd74cff3b34fc8e374174a", + "reference": "4c92a15296e58191a4cd74cff3b34fc8e374174a", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.2.0", + "doctrine/instantiator": "^1.1", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.9.1", - "phar-io/manifest": "^1.0.3", - "phar-io/version": "^2.0.1", - "php": "^7.2", - "phpspec/prophecy": "^1.8.1", - "phpunit/php-code-coverage": "^7.0.7", - "phpunit/php-file-iterator": "^2.0.2", + "myclabs/deep-copy": "^1.7", + "phar-io/manifest": "^1.0.2", + "phar-io/version": "^2.0", + "php": "^7.1", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^6.0.7", + "phpunit/php-file-iterator": "^2.0.1", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.1.2", - "sebastian/comparator": "^3.0.2", - "sebastian/diff": "^3.0.2", - "sebastian/environment": "^4.2.2", - "sebastian/exporter": "^3.1.1", - "sebastian/global-state": "^3.0.0", + "phpunit/php-timer": "^2.1", + "sebastian/comparator": "^3.0", + "sebastian/diff": "^3.0", + "sebastian/environment": "^4.0", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^2.0.1", - "sebastian/type": "^1.1.3", + "sebastian/resource-operations": "^2.0", "sebastian/version": "^2.0.1" }, + "conflict": { + "phpunit/phpunit-mock-objects": "*" + }, "require-dev": { "ext-pdo": "*" }, "suggest": { "ext-soap": "*", "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0.0" + "phpunit/php-invoker": "^2.0" }, "bin": [ "phpunit" @@ -1169,7 +1171,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "8.4-dev" + "dev-master": "7.5-dev" } }, "autoload": { @@ -1195,7 +1197,7 @@ "testing", "xunit" ], - "time": "2019-10-07T12:57:41+00:00" + "time": "2019-10-28T10:37:36+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -1484,26 +1486,23 @@ }, { "name": "sebastian/global-state", - "version": "3.0.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4" + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4", - "reference": "edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", "shasum": "" }, "require": { - "php": "^7.2", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" + "php": "^7.0" }, "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^8.0" + "phpunit/phpunit": "^6.0" }, "suggest": { "ext-uopz": "*" @@ -1511,7 +1510,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1534,7 +1533,7 @@ "keywords": [ "global state" ], - "time": "2019-02-01T05:30:01+00:00" + "time": "2017-04-27T15:39:26+00:00" }, { "name": "sebastian/object-enumerator", @@ -1723,52 +1722,6 @@ "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "time": "2018-10-04T04:07:39+00:00" }, - { - "name": "sebastian/type", - "version": "1.1.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "3aaaa15fa71d27650d62a948be022fe3b48541a3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/3aaaa15fa71d27650d62a948be022fe3b48541a3", - "reference": "3aaaa15fa71d27650d62a948be022fe3b48541a3", - "shasum": "" - }, - "require": { - "php": "^7.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", - "time": "2019-07-02T08:10:15+00:00" - }, { "name": "sebastian/version", "version": "2.0.1", @@ -1909,8 +1862,8 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.3", - "ext-json": "^1.7", + "php": "^7.1", + "ext-json": "^1.5", "ext-reflection": "*" }, "platform-dev": [] diff --git a/src/BitPaySDK/Client.php b/src/BitPaySDK/Client.php index 72241317..7542db74 100644 --- a/src/BitPaySDK/Client.php +++ b/src/BitPaySDK/Client.php @@ -44,9 +44,9 @@ * Class Client * @package Bitpay * @author Antonio Buedo - * @version 3.0.1910 + * @version 3.2.1911 * See bitpay.com/api for more information. - * date 10.10.2019 + * date 05.11.2019 */ class Client { diff --git a/src/BitPaySDK/Env.php b/src/BitPaySDK/Env.php index d2d89afa..147400c3 100644 --- a/src/BitPaySDK/Env.php +++ b/src/BitPaySDK/Env.php @@ -11,5 +11,5 @@ interface Env const TestUrl = "https://test.bitpay.com/"; const ProdUrl = "https://bitpay.com/"; const BitpayApiVersion = "2.0.0"; - const BitpayPluginInfo = "BitPay_PHP_Client_v3.0.1910"; + const BitpayPluginInfo = "BitPay_PHP_Client_v3.2.1911"; } \ No newline at end of file diff --git a/src/BitPaySDK/Model/Invoice/InvoiceStatus.php b/src/BitPaySDK/Model/Invoice/InvoiceStatus.php index 081f8a0e..48ac2688 100644 --- a/src/BitPaySDK/Model/Invoice/InvoiceStatus.php +++ b/src/BitPaySDK/Model/Invoice/InvoiceStatus.php @@ -6,10 +6,10 @@ interface InvoiceStatus { - const New = "new"; - const Funded = "funded"; - const Processing = "processing"; - const Complete = "complete"; - const Failed = "failed"; - const Cancelled = "cancelled"; + const New = "new"; + const Paid = "paid"; + const Confirmed = "confirmed"; + const Complete = "complete"; + const Expired = "expired"; + const Invalid = "invalid"; } \ No newline at end of file diff --git a/src/BitPaySDK/Model/Invoice/Refund.php b/src/BitPaySDK/Model/Invoice/Refund.php index e2377ea1..ab752eb6 100644 --- a/src/BitPaySDK/Model/Invoice/Refund.php +++ b/src/BitPaySDK/Model/Invoice/Refund.php @@ -67,6 +67,11 @@ public function getToken() return $this->_token; } + public function setToken(string $token) + { + $this->_token = $token; + } + public function getCurrency() { return $this->_currency; @@ -77,11 +82,6 @@ public function setCurrency(string $currency) $this->_currency = $currency; } - public function setToken(string $token) - { - $this->_token = $token; - } - // Response fields // diff --git a/tests/BitPaySDK/BitPayTest.php b/tests/BitPaySDK/BitPayTest.php index 0ddf3592..0856c277 100644 --- a/tests/BitPaySDK/BitPayTest.php +++ b/tests/BitPaySDK/BitPayTest.php @@ -401,7 +401,7 @@ public function testShouldGetBillsByStatus() { $bills = null; try { - $bills = $this->client->getBills(BillStatus::New); + $bills = $this->client->getBills(BillStatus::Draft); } catch (\Exception $e) { $e->getTraceAsString(); self::fail($e->getMessage());