Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from contributte:master #6

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
49bdd37
update doc - required params (#73)
JanHrivnak Oct 13, 2020
ce828ec
Fix compatibility of RecurrentPaymentFactory (#76)
PavelJurasek Oct 16, 2020
01a960a
Added Apple Pay to payment instruments
Trsak Nov 7, 2020
7c1ed2a
Tests fix
Trsak Nov 8, 2020
4fca1fc
Std [004]: kodiak
f3l1x Dec 23, 2020
250cb2b
V2: money object, strict types, type hints (#63)
PavelJurasek Dec 30, 2020
9ee2709
update readme
PavelJurasek Dec 30, 2020
d7605e3
update docs
PavelJurasek Dec 30, 2020
81d931b
Add VUB_BANK back to SwiftCode constants (#80)
MichaelTichy222 Feb 8, 2021
d8cdc9c
unify syntax in readmes (#81)
petrparolek Mar 12, 2021
0962266
Fix: item.amount must by "Total price of items in cents" (#83)
bohacf Apr 18, 2021
74c5166
polished readme and docs (#84)
petrparolek Apr 18, 2021
87a32c0
Fix partial capture (#85)
zingon May 6, 2021
6eb466e
Codestyle: improvements (#86)
petrparolek Jun 28, 2021
a1d6a95
Composer: homepage typo
f3l1x Jul 23, 2021
b0f4035
Drop github funding
f3l1x Aug 13, 2021
3c75675
Readme: badges
f3l1x Nov 12, 2021
26306bd
Makefile++
f3l1x Nov 12, 2021
8650219
fixed GitHub Actions
petrparolek Dec 21, 2021
269b0fc
update composer to v2 in CI
petrparolek Dec 21, 2021
8125db7
upgrade PHPStan
petrparolek Dec 21, 2021
ba87b73
Added PHP 8.1 to Github Actions (#90)
jakubsedlarik Apr 1, 2022
76eb75d
Readme: typo [#91]
f3l1x May 15, 2022
020b9e0
Allow version 4 of moneyphp/money dependency
jakubsedlarik Jul 22, 2022
5bc94ae
Added endpoint for cancelling recurrent payments
kotmic Aug 23, 2022
71e3a1b
Tests: fixup (#97)
kotmic Sep 13, 2022
e87e1e7
Repo: modernize
f3l1x Sep 13, 2022
fee1d14
Phpstan: modernize
f3l1x Sep 13, 2022
b8172a1
CI: new workflows
f3l1x Sep 13, 2022
ef5080e
Composer: update deps & simplify
f3l1x Sep 13, 2022
16659c5
Code: polished
f3l1x Sep 13, 2022
1df2575
Readme++
f3l1x Sep 13, 2022
2dde177
Tests: fix cases
f3l1x Sep 13, 2022
b26ef83
Composer: require nette/di 3.0+
f3l1x Sep 13, 2022
42e731a
Open v2.2.0
f3l1x Sep 13, 2022
1f60992
CancelRecurrentPayment: contentType fix (#98)
zeddosx Oct 13, 2022
1c6848b
Test: fix cancel recurrent payment
f3l1x Mar 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 25 additions & 22 deletions .docs/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Contributte GopayInline
# Contributte / Gopay-Inline

## Content

## Prolog

Expand All @@ -8,8 +10,8 @@ This library has no dependencies on other `php` libraries. It provides easy-to-u

Install **Markette/GopayInline** over composer.

```sh
$ composer require markette/gopay-inline
```bash
composer require markette/gopay-inline
```

Why is the package still called Markette? Because we don't want to break other people's projects (for now).
Expand Down Expand Up @@ -122,28 +124,29 @@ $payment = [
'country_code' => 'CZE',
],
],
'amount' => 50000,
'currency' => Currency::CZK,
'amount' => \Money\Money::CZK(50000),
'order_number' => '001',
'order_description' => 'some order',
'items' => [
['name' => 'item01', 'amount' => 40000],
['name' => 'item02', 'amount' => 13000],
['name' => 'item03', 'amount' => 7000],
['name' => 'item01', 'amount' => \Money\Money::CZK(40000)],
['name' => 'item02', 'amount' => \Money\Money::CZK(13000)],
['name' => 'item03', 'amount' => \Money\Money::CZK(7000)],
],
'eet' => [
'celk_trzba' => 50000,
'zakl_dan1' => 35000,
'dan1' => 5000,
'zakl_dan2' => 8000,
'dan2' => 2000,
'celk_trzba' => \Money\Money::CZK(50000),
'zakl_dan1' => \Money\Money::CZK(35000),
'dan1' => \Money\Money::CZK(5000),
'zakl_dan2' => \Money\Money::CZK(8000),
'dan2' => \Money\Money::CZK(2000),
'mena' => Currency::CZK,
],
'additional_params' => [
['name' => 'invoicenumber', 'value' => '2017001'],
],
'return_url' => 'http://www.myeshop.cz/api/gopay/return',
'notify_url' => 'http://www.myeshop.cz/api/gopay/notify',
'callback' => [
'return_url' => 'http://www.myeshop.cz/api/gopay/return',
'notify_url' => 'http://www.myeshop.cz/api/gopay/notify',
],
'lang' => Language::CZ,
];
```
Expand Down Expand Up @@ -192,7 +195,7 @@ Now we have a response with payment information. There's same data as we send it

```php
if ($response->isSuccess()) {
// ...
// ...
}
```

Expand Down Expand Up @@ -228,15 +231,15 @@ $response = $client->payments->verify($paymentId);

Fill your credentials in config.

```yaml
```neon
extensions:
gopay: Contributte\GopayInline\Bridges\Nette\DI\GopayExtension
gopay: Contributte\GopayInline\Bridges\Nette\DI\GopayExtension

gopay:
goId: ***
clientId: ***
clientSecret: ***
test: on / off
goId: ***
clientId: ***
clientSecret: ***
test: on / off
```

Inject `Client` into your services / presenters;
Expand Down
25 changes: 5 additions & 20 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,31 +1,16 @@
# EditorConfig is awesome: http://EditorConfig.org

# Top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true

# JS / PHP
[*.{js,php,phpt}]
charset = utf-8
trim_trailing_whitespace = true
indent_style = tab
indent_size = 4
indent_size = tab
tab_width = 4

# NEON
[*.neon]
charset = utf-8
indent_style = tab
indent_size = 4

# YAML
[*.yml]
[{*.json,*.yml,*.yaml,*.md}]
indent_style = space
indent_size = 2

# Composer, NPM
[{composer.json,package.json}]
indent_style = tab
indent_size = 2
12 changes: 8 additions & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Not archived
.docs export-ignore
tests export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
composer.lock export-ignore
tests export-ignore
examples export-ignore
*.md export-ignore
Makefile export-ignore
phpstan.neon export-ignore
README.md export-ignore
ruleset.xml export-ignore
10 changes: 10 additions & 0 deletions .github/.kodiak.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version = 1

[merge]
automerge_label = "automerge"
blacklist_title_regex = "^WIP.*"
blacklist_labels = ["WIP"]
method = "rebase"
delete_branch_on_merge = true
notify_on_conflict = true
optimistic_updates = false
15 changes: 15 additions & 0 deletions .github/workflows/codesniffer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "Codesniffer"

on:
pull_request:

push:
branches: ["*"]

schedule:
- cron: "0 8 * * 1"

jobs:
codesniffer:
name: "Codesniffer"
uses: contributte/.github/.github/workflows/codesniffer.yml@v1
31 changes: 31 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "Phpstan"

on:
pull_request:

push:
branches: ["*"]

schedule:
- cron: "0 8 * * 1"

jobs:
phpstan81:
name: "Phpstan"
uses: contributte/.github/.github/workflows/phpstan.yml@v1
with:
php: "8.1"


phpstan80:
name: "Phpstan"
uses: contributte/.github/.github/workflows/phpstan.yml@v1
with:
php: "8.0"

lower:
name: "Nette Tester"
uses: contributte/.github/.github/workflows/phpstan.yml@v1
with:
php: "7.2"
composer: "composer update --no-interaction --no-progress --prefer-dist --prefer-stable --prefer-lowest"
30 changes: 30 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: "Nette Tester"

on:
pull_request:

push:
branches: [ "*" ]

schedule:
- cron: "0 8 * * 1"

jobs:
test81:
name: "Nette Tester"
uses: contributte/.github/.github/workflows/nette-tester.yml@v1
with:
php: "8.1"

test80:
name: "Nette Tester"
uses: contributte/.github/.github/workflows/nette-tester.yml@v1
with:
php: "8.0"

lower:
name: "Nette Tester"
uses: contributte/.github/.github/workflows/nette-tester.yml@v1
with:
php: "7.2"
composer: "composer update --no-interaction --no-progress --prefer-dist --prefer-stable --prefer-lowest"
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# IDE
/.idea

# Composer
/vendor
/composer.lock

# Tests
/coverage.xml
71 changes: 0 additions & 71 deletions .travis.yml

This file was deleted.

42 changes: 22 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
.PHONY: qa lint cs csf phpstan tests coverage
.PHONY: install qa cs csf phpstan tests coverage

all:
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs
install:
composer update

vendor: composer.json composer.lock
composer install
qa: phpstan cs

qa: lint phpstan cs
cs:
ifdef GITHUB_ACTION
vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 --colors -nsp -q --report=checkstyle src tests | cs2pr
else
vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 --colors -nsp src tests
endif

lint: vendor
vendor/bin/linter src tests
csf:
vendor/bin/phpcbf --standard=ruleset.xml --encoding=utf-8 --colors -nsp src tests

cs: vendor
vendor/bin/codesniffer src tests
phpstan:
vendor/bin/phpstan analyse -c phpstan.neon

csf: vendor
vendor/bin/codefixer src tests
tests:
vendor/bin/tester -s -p php --colors 1 -C tests/Cases

phpstan: vendor
vendor/bin/phpstan analyse -l 5 -c phpstan.neon src

tests: vendor
vendor/bin/tester -s -p php --colors 1 tests/cases

coverage: vendor
vendor/bin/tester -s -p phpdbg --colors 1 --coverage ./coverage.xml --coverage-src ./src tests/cases
coverage:
ifdef GITHUB_ACTION
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage coverage.xml --coverage-src src tests/Cases
else
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage coverage.html --coverage-src src tests/Cases
endif
Loading