-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'v1.x' into v1.x-spring1
- Loading branch information
Showing
39 changed files
with
712 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Apiary | ||
description: Issue about documentation for ThePay.cz WS API | ||
labels: ["Apiary"] | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: "If you don't understand something in ThePay WS API documentation, miss some information, or find the documentation inconsistent with returned values from the API, let us know in the description below." | ||
- type: textarea | ||
attributes: | ||
label: Description | ||
description: Describe the problem as detailed as you can. | ||
render: markdown | ||
validations: | ||
required: true | ||
- type: input | ||
attributes: | ||
label: Merchant/project | ||
description: | | ||
If you need to identify yourself for the troubleshooting process, prefer to use your project ID or public URL. | ||
Do not share your merchant ID or any other authentication information. | ||
validations: | ||
required: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: PHP SDK | ||
description: Issue about PHP SDK for ThePay.cz WS API | ||
labels: ["PHP SDK"] | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: "If you have any problem with your SDK implementation, you found anything inconsistent with the WS API documentation, or you need anything new, let us know in the description below." | ||
- type: textarea | ||
attributes: | ||
label: Description | ||
description: Describe the problem as detailed as you can. | ||
render: markdown | ||
validations: | ||
required: true | ||
- type: dropdown | ||
attributes: | ||
label: Environment | ||
description: What environment do you call? | ||
multiple: true | ||
options: | ||
- Production | ||
- Demo | ||
- Apiary mock | ||
- Apiary proxy | ||
validations: | ||
required: false | ||
- type: input | ||
attributes: | ||
label: PHP version | ||
description: What PHP version do you use? | ||
validations: | ||
required: false | ||
- type: input | ||
attributes: | ||
label: SDK version | ||
description: What SDK version do you use? | ||
validations: | ||
required: false | ||
- type: input | ||
attributes: | ||
label: Merchant/project | ||
description: | | ||
If you need to identify yourself for the troubleshooting process, prefer to use your project ID or public URL. | ||
Do not share your merchant ID or any other authentication information. | ||
validations: | ||
required: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: WS API | ||
description: Issue about server implementation of ThePay.cz WS API | ||
labels: ["WS API", "bug"] | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: "If the API call failed for some reason, returned unexpected data, or if the API is slow, let us know in the description below." | ||
- type: textarea | ||
attributes: | ||
label: Description | ||
description: Describe the problem as detailed as you can. | ||
render: markdown | ||
validations: | ||
required: true | ||
- type: dropdown | ||
attributes: | ||
label: Environment | ||
description: What environment do you call? | ||
multiple: true | ||
options: | ||
- Production | ||
- Demo | ||
- Apiary mock | ||
- Apiary proxy | ||
validations: | ||
required: true | ||
- type: input | ||
attributes: | ||
label: Platform | ||
description: What platform do you use? (PHP, Java, Js, ...) | ||
validations: | ||
required: false | ||
- type: input | ||
attributes: | ||
label: Merchant/project | ||
description: | | ||
If you need to identify yourself for the troubleshooting process, prefer to use your project ID or public URL. | ||
Do not share your merchant ID or any other authentication information. | ||
validations: | ||
required: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,19 @@ interacts with The Pay's REST API. To get started see examples below. | |
|
||
To install the SDK we recommend to use [Composer](https://getcomposer.org/): | ||
|
||
composer require thepay/api-client | ||
```console | ||
composer require thepay/api-client | ||
``` | ||
|
||
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## Support & Contributions | ||
|
||
If you find any bug, please submit the [issue](https://github.com/ThePay/api-client/issues/new/choose) in Github directly. | ||
|
||
Feel free to contribute via Github [issues](https://github.com/ThePay/api-client/issues) and | ||
[pull requests](https://github.com/ThePay/api-client/pulls). We will response as soon as possible. | ||
Please have on mind the backwards compatibility and do not change requirements without previous admin agreement. | ||
|
||
## Preconditions | ||
|
||
|
@@ -28,7 +40,7 @@ Make sure that you have all required credentials and that you've set up the API | |
|
||
You can find all the necessary credentials in "Implementation" section under your merchant profile: | ||
|
||
![](https://bitbucket.org/thepaygate/thepay-v2-php-sdk/raw/HEAD/doc/img/the-admin-credentials.png) | ||
![](../doc/img/the-admin-credentials.png) | ||
|
||
## Usage | ||
|
||
|
@@ -38,7 +50,7 @@ You will work with only two classes when using this SDK. | |
|
||
## Configuration | ||
|
||
All constructor parameters are described in [php doc](https://bitbucket.org/thepaygate/thepay-v2-php-sdk/src/HEAD/src/TheConfig.php) | ||
All constructor parameters are described in [php doc](../src/TheConfig.php) | ||
|
||
```php | ||
$config = new ThePay\ApiClient\TheConfig( | ||
|
@@ -73,7 +85,7 @@ No matter what method you choose, you have two more options, based on preselecti | |
|
||
Even if you (or your customer) preselect the payment method, it can still be changed after redirection, unless specifically forbidden. | ||
|
||
![](https://bitbucket.org/thepaygate/thepay-v2-php-sdk/raw/HEAD/doc/img/payment_flow.png) | ||
![](../doc/img/payment_flow.png) | ||
|
||
#### REST API | ||
You can create payment (link) via REST API and redirect user to that link. The payment itself is created through an API call. | ||
|
@@ -109,7 +121,7 @@ These are the usual ways for payment creation: | |
|
||
Always create only one payment for your order for all payment creation options, unless you need to change the payment amount. In that case, consider it a whole new payment. | ||
|
||
For more examples see [create-payment.md](https://bitbucket.org/thepaygate/thepay-v2-php-sdk/src/HEAD/doc/create-payment.md) | ||
For more examples see [create-payment.md](../doc/create-payment.md) | ||
|
||
```php | ||
use ThePay\ApiClient\TheConfig; | ||
|
@@ -203,18 +215,13 @@ if ($payment->wasPaid()) { | |
|
||
## More and detailed usage examples | ||
|
||
You can find more usage examples at [folder /doc](https://bitbucket.org/thepaygate/thepay-v2-php-sdk/src/HEAD/doc/index.md). | ||
You can find more usage examples at [folder /doc](../doc/index.md). | ||
|
||
## Money calculations | ||
|
||
For safe money calculations we recommend to use [moneyphp/money](https://github.com/moneyphp/money) package. | ||
Please, do not use float to save information about prices because of its inaccuracy. | ||
|
||
composer require moneyphp/money | ||
|
||
## Support & Contributions | ||
|
||
If you find any bug, please submit the issue in Github directly or contact us on email: [[email protected]](mailto:[email protected]) | ||
|
||
Feel free to contribute via Github issues and pull requests. We will response as soon as possible. | ||
Please have on mind the backwards compatibility and do not change requirements without previous admin agreement. | ||
```console | ||
composer require moneyphp/money | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,187 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- "*" | ||
|
||
jobs: | ||
php81: | ||
name: "php 8.1" | ||
runs-on: ubuntu-latest | ||
container: "nofutur3/php-tests:8.1" | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: composer install --no-interaction | ||
- name: Phpstan has to be added in pipeline bc it requires PHP 7.1+ | ||
run: composer require phpstan/phpstan --dev --no-interaction | ||
- name: Old phpunit compatibility for php 8 | ||
run: composer require christiaanbye/polyfill-each --dev --no-interaction | ||
|
||
- name: Check code style | ||
run: composer cs-check | ||
|
||
- name: Run static analysis | ||
run: composer stan | ||
|
||
- name: Run tests | ||
run: composer test81 | ||
|
||
php80: | ||
name: "php 8.0" | ||
runs-on: ubuntu-latest | ||
container: "nofutur3/php-tests:8.0" | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: composer install --no-interaction | ||
- name: Phpstan has to be added in pipeline bc it requires PHP 7.1+ | ||
run: composer require phpstan/phpstan --dev --no-interaction | ||
- name: Old phpunit compatibility for php 8 | ||
run: composer require christiaanbye/polyfill-each --dev --no-interaction | ||
|
||
- name: Check code style | ||
run: composer cs-check | ||
|
||
- name: Run static analysis | ||
run: composer stan | ||
|
||
- name: Run tests | ||
run: composer test | ||
|
||
php74: | ||
name: "php 7.4" | ||
runs-on: ubuntu-latest | ||
container: "nofutur3/php-tests:7.4" | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: composer install --no-interaction | ||
- name: Phpstan has to be added in pipeline bc it requires PHP 7.1+ | ||
run: composer require phpstan/phpstan --dev --no-interaction | ||
|
||
- name: Run static analysis | ||
run: composer stan7 | ||
|
||
- name: Run tests | ||
run: composer test | ||
|
||
php73: | ||
name: "php 7.3" | ||
runs-on: ubuntu-latest | ||
container: "nofutur3/php-tests:7.3" | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: composer install --no-interaction | ||
- name: Phpstan has to be added in pipeline bc it requires PHP 7.1+ | ||
run: composer require phpstan/phpstan --dev --no-interaction | ||
|
||
- name: Run static analysis | ||
run: composer stan7 | ||
|
||
- name: Run tests | ||
run: composer test | ||
|
||
php72: | ||
name: "php 7.2" | ||
runs-on: ubuntu-latest | ||
container: "nofutur3/php-tests:7.2" | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: composer install --no-interaction | ||
- name: Phpstan has to be added in pipeline bc it requires PHP 7.1+ | ||
run: composer require phpstan/phpstan --dev --no-interaction | ||
|
||
- name: Run static analysis | ||
run: composer stan7 | ||
|
||
- name: Run tests | ||
run: composer test | ||
|
||
php71: | ||
name: "php 7.1" | ||
runs-on: ubuntu-latest | ||
container: "nofutur3/php-tests:7.1" | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: composer install --no-interaction | ||
- name: Phpstan has to be added in pipeline bc it requires PHP 7.1+ | ||
run: composer require phpstan/phpstan --dev --no-interaction | ||
|
||
- name: Run static analysis | ||
run: composer stan7 | ||
|
||
- name: Run tests | ||
run: composer test | ||
|
||
php70: | ||
name: "php 7.0" | ||
runs-on: ubuntu-latest | ||
container: "nofutur3/php-component:7.0" | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: composer install --no-interaction | ||
|
||
- name: Run tests | ||
run: composer test | ||
|
||
php56: | ||
name: "php 5.6" | ||
runs-on: ubuntu-latest | ||
container: "nofutur3/php-component:5.6" | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: composer install --no-interaction | ||
|
||
- name: Run tests | ||
run: composer test | ||
|
||
php55: | ||
name: "php 5.5" | ||
runs-on: ubuntu-latest | ||
container: "nofutur3/php-component:5.5" | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: composer install --no-interaction | ||
|
||
- name: Run tests | ||
run: composer test | ||
|
||
php53: | ||
name: "php 5.3" | ||
runs-on: ubuntu-latest | ||
container: "nofutur3/php-component:5.3" | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: composer install --no-interaction | ||
|
||
- name: Run tests | ||
run: composer test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.