diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 1873d7a..29ad9f3 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -4,7 +4,7 @@ on: push: branches: [ develop ] pull_request: - branches: [ develop ] + branches: [ master ] jobs: cs: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d783ab7..df3e84b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,7 +4,7 @@ on: push: branches: [ develop ] pull_request: - branches: [ develop ] + branches: [ master ] jobs: ci: diff --git a/CHANGELOG.md b/CHANGELOG.md index e444d53..49f31a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 2.0.0 - 2022-09-19 +### Changed +- **Breaking:** Updated SDK to work with PHP8. Version 2 requires PHP8 as a minimum now. + ## 1.1.0 - 2019-12-16 - Support for additional headers in requests - fixes [issue 56](https://github.com/QuickPay/quickpay-php-client/issues/56). diff --git a/README.md b/README.md index d1ddd4f..76dcb64 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ quickpay-php-client ====================== -`quickpay-php-client` is a official client for [QuickPay API](http://tech.quickpay.net/api). The QuickPay API enables you to accept payments in a secure and reliable manner. This package currently support QuickPay `v10` api. +`quickpay-php-client` is a official client for [QuickPay API](http://learn.quickpay.net/tech-talk/api/). The QuickPay API enables you to accept payments in a secure and reliable manner. This package currently support QuickPay `v10` api. ## Installation @@ -12,7 +12,7 @@ Simply add a dependency on quickpay/quickpay-php-client to your project's compos ``` { "require": { - "quickpay/quickpay-php-client": "1.0.*" + "quickpay/quickpay-php-client": "2.0.*" } } ``` @@ -31,7 +31,7 @@ First you should create a client instance that is anonymous or authorized with ` To initialise an anonymous client: -```php5 +```php8 request->get('/payments'); @@ -103,7 +103,7 @@ if ($status == 201) { ### Handling the response Getting the `HTTP status code`: -```php5 +```php8 $response = $client->request->get('/payments'); $status = $response->httpStatus(); @@ -114,7 +114,7 @@ if ($status == 200) { The returned response object supports 3 different ways of returning the response body, `asRaw()`, `asObject`, `asArray()`. -```php5 +```php8 // Get the HTTP status code, headers and raw response body. list($status_code, $headers, $response_body) = $client->request->get('/payments')->asRaw(); @@ -133,7 +133,19 @@ foreach($payments as $payment) { ``` -You can read more about api responses at [http://tech.quickpay.net/api/](http://tech.quickpay.net/api). +### Setting timeouts +Set timeout and get notified on timeouts: + +```php8 +QuickPayAPI::$timeout = 30; +QuickPayAPI::$onTimeout ??= function () { + event(new PaymentGatewayTimeout($this)); + + throw new TimeoutException("No response from Quickpay within " . QuickPayAPI::$timeout . " seconds"); +}; +``` + +You can read more about api responses at [http://learn.quickpay.net/tech-talk/api/](http://learn.quickpay.net/tech-talk/api/). ## Tests