From 32d2a170be4020ecbd1e48779fdda005f110d4eb Mon Sep 17 00:00:00 2001 From: Rhys Lees <43909932+RhysLees@users.noreply.github.com> Date: Thu, 8 Feb 2024 23:56:18 +0000 Subject: [PATCH 01/14] WIP --- .github/ISSUE_TEMPLATE/bug.yml | 52 +++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 15 +++--- .github/workflows/dependabot-auto-merge.yml | 10 ++-- .github/workflows/dependency-review.yml | 20 +++++++ ...ixer.yml => fix-php-code-style-issues.yml} | 15 ++---- .github/workflows/phpstan.yml | 12 ++--- .github/workflows/run-tests.yml | 28 ++++++---- .gitignore | 1 + README.md | 12 ++++- composer.json | 31 +++++------ src/Client/PostfinanceClientFactory.php | 3 +- tests/Feature/GetInvoiceListPayerTest.php | 3 +- tests/Feature/GetInvoicePayerTest.php | 3 +- tests/Feature/PingTest.php | 5 +- 14 files changed, 145 insertions(+), 65 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug.yml create mode 100644 .github/workflows/dependency-review.yml rename .github/workflows/{php-cs-fixer.yml => fix-php-code-style-issues.yml} (54%) diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml new file mode 100644 index 0000000..52f37d5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -0,0 +1,52 @@ +name: Bug Report +description: Report an Issue or Bug with the Package +title: "[Bug]: " +labels: ["bug"] +body: + - type: markdown + attributes: + value: | + We're sorry to hear you have a problem. Can you help us solve it by providing the following details. + - type: textarea + id: what-happened + attributes: + label: What happened? + description: What did you expect to happen? + placeholder: I cannot currently do X thing because when I do, it breaks X thing. + validations: + required: true + + - type: input + id: package-version + attributes: + label: Package Version + description: What version of our Package are you running? Please be as specific as possible + placeholder: 2.0.0 + validations: + required: true + - type: input + id: php-version + attributes: + label: PHP Version + description: What version of PHP are you running? Please be as specific as possible + placeholder: 8.2.0 + validations: + required: true + - type: input + id: laravel-version + attributes: + label: Laravel Version + description: What version of Laravel are you running? Please be as specific as possible + placeholder: 9.0.0 + validations: + required: true + - type: dropdown + id: operating-systems + attributes: + label: Which operating systems does with happen with? + description: You may select more than one. + multiple: true + options: + - macOS + - Windows + - Linux diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index b4e8146..e5264a1 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,11 +1,8 @@ blank_issues_enabled: false contact_links: - - name: Ask a question - url: https://github.com/codebar-ag/laravel-flatfox/discussions/new?category=q-a - about: Ask the community for help - - name: Request a feature - url: https://github.com/codebar-ag/laravel-flatfox/discussions/new?category=ideas - about: Share ideas for new features - - name: Report a bug - url: https://github.com/codebar-ag/laravel-flatfox/issues/new - about: Report a reproducable bug + - name: Questions & Feature Requests + url: https://github.com/codebar-ag/laravel-postfinance-b2b/issues/new + about: Ask the community for help + - name: Report a security issue + url: https://github.com/codebar-ag/laravel-postfinance-b2b/security/policy + about: Learn how to notify us for sensitive bugs diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index 14da349..3451cb2 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -1,3 +1,4 @@ + name: dependabot-auto-merge on: pull_request_target @@ -10,20 +11,21 @@ jobs: runs-on: ubuntu-latest if: ${{ github.actor == 'dependabot[bot]' }} steps: - + - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v1.3.3 + + uses: dependabot/fetch-metadata@v1.4.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" - + - name: Auto-merge Dependabot PRs for semver-minor updates if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}} run: gh pr merge --auto --merge "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - + - name: Auto-merge Dependabot PRs for semver-patch updates if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}} run: gh pr merge --auto --merge "$PR_URL" diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml new file mode 100644 index 0000000..b0dedc4 --- /dev/null +++ b/.github/workflows/dependency-review.yml @@ -0,0 +1,20 @@ +# Dependency Review Action +# +# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging. +# +# Source repository: https://github.com/actions/dependency-review-action +# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement +name: 'Dependency Review' +on: [pull_request] + +permissions: + contents: read + +jobs: + dependency-review: + runs-on: ubuntu-latest + steps: + - name: 'Checkout Repository' + uses: actions/checkout@v3 + - name: 'Dependency Review' + uses: actions/dependency-review-action@v3 diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/fix-php-code-style-issues.yml similarity index 54% rename from .github/workflows/php-cs-fixer.yml rename to .github/workflows/fix-php-code-style-issues.yml index 3517cf1..cc0c956 100644 --- a/.github/workflows/php-cs-fixer.yml +++ b/.github/workflows/fix-php-code-style-issues.yml @@ -1,12 +1,9 @@ -name: Check & fix styling +name: Fix PHP code style issues -on: - push: - branches: - - styling +on: [push] jobs: - php-cs-fixer: + php-code-styling: runs-on: ubuntu-latest steps: @@ -15,10 +12,8 @@ jobs: with: ref: ${{ github.head_ref }} - - name: Run PHP CS Fixer - uses: docker://oskarstark/php-cs-fixer-ga - with: - args: --config=.php-cs-fixer.dist.php --allow-risky=yes + - name: Fix PHP code style issues + uses: aglipanci/laravel-pint-action@2.2.0 - name: Commit changes uses: stefanzweifel/git-auto-commit-action@v4 diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 557d263..090fd83 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -2,9 +2,9 @@ name: PHPStan on: push: - paths: - - '**.php' - - 'phpstan.neon.dist' + branches: [ main ] + pull_request: + branches: [ main ] jobs: phpstan: @@ -16,11 +16,11 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' coverage: none - name: Install composer dependencies - uses: ramsey/composer-install@v1 + uses: ramsey/composer-install@v2 - name: Run PHPStan - run: ./vendor/bin/phpstan --error-format=github + run: ./vendor/bin/phpstan analyse src --error-format=github diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index bff3889..3ca5518 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -11,16 +11,15 @@ jobs: runs-on: ${{ matrix.os }} strategy: fail-fast: true + max-parallel: 1 matrix: - # os: [ ubuntu-latest, windows-latest ] - os: [ ubuntu-latest ] - php: [ 8.1 ] - laravel: [ 9.* ] - #stability: [ prefer-lowest, prefer-stable ] - stability: [ prefer-stable ] + os: [ ubuntu-latest, windows-latest ] + php: [ 8.2, 8.3 ] + laravel: [ 10.* ] + stability: [ prefer-lowest, prefer-stable ] include: - - laravel: 9.* - testbench: 7.* + - laravel: 10.* + testbench: 8.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} @@ -45,12 +44,19 @@ jobs: composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update composer update --${{ matrix.stability }} --prefer-dist --no-interaction + - name: Set phpunit.xml + run: cp phpunit.xml.dist phpunit.xml + - name: Execute tests run: vendor/bin/pest env: - ZAMMAD_URL: ${{ secrets.ZAMMAD_URL }} - ZAMMAD_TOKEN: ${{ secrets.ZAMMAD_TOKEN }} - ZAMMAD_OBJECT_REFERENCE_ERROR_IGNORE: true + POSTFINANCE_B2B_USERNAME: ${{ secrets.POSTFINANCE_B2B_USERNAME }} + POSTFINANCE_B2B_PASSWORD: ${{ secrets.POSTFINANCE_B2B_PASSWORD }} + POSTFINANCE_B2B_DEBUG: ${{ secrets.POSTFINANCE_B2B_DEBUG }} + POSTFINANCE_B2B_TESTS_PAYER_ID: ${{ secrets.POSTFINANCE_B2B_TESTS_PAYER_ID }} + POSTFINANCE_B2B_TESTS_BILLER_ID: ${{ secrets.POSTFINANCE_B2B_TESTS_BILLER_ID }} + POSTFINANCE_B2B_TESTS_TRANSACTION_ID: ${{ secrets.POSTFINANCE_B2B_TESTS_TRANSACTION_ID }} + POSTFINANCE_B2B_TESTS_FILE_TYPE: ${{ secrets.POSTFINANCE_B2B_TESTS_FILE_TYPE }} - name: Store test reports uses: actions/upload-artifact@v2 diff --git a/.gitignore b/.gitignore index d16f891..a510a25 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ .php_cs.cache .php-cs-fixer.cache .phpunit.result.cache +.phpunit.cache .DS_STORE build composer.lock diff --git a/README.md b/README.md index 2fc1e9b..9ecc179 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,16 @@ cp phpunit.xml.dist phpunit.xml Modify environment variables in the phpunit.xml-file: ```xml - - + + + + + + + + + + ``` Run the tests: diff --git a/composer.json b/composer.json index db13cc9..a7264ce 100644 --- a/composer.json +++ b/composer.json @@ -19,31 +19,32 @@ } ], "require": { - "php": "^8.2", + "php": "^8.2|^8.3", "ext-soap": "*", "ext-xsl": "*", - "guzzlehttp/guzzle": "^7.5", + "guzzlehttp/guzzle": "^7.8", "illuminate/contracts": "^10.0", "monolog/monolog": "^3.5", "nyholm/psr7": "^1.8", "php-http/logger-plugin": "^1.3", "php-soap/psr18-wsse-middleware": "^2.3", "phpro/soap-client": "^3.1", - "spatie/laravel-package-tools": "^1.9.2", - "symfony/http-client": "^6.2" + "spatie/laravel-package-tools": "^1.16", + "symfony/http-client": "^6.4" }, "require-dev": { - "laravel/pint": "^1.5", - "nunomaduro/collision": "^7.0", - "nunomaduro/larastan": "^2.4.0", - "orchestra/testbench": "^8.0", - "pestphp/pest": "2.x-dev", - "pestphp/pest-plugin-laravel": "2.x-dev", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^10.0", - "spatie/laravel-ray": "^1.9" + "laravel/pint": "^1.13", + "nunomaduro/collision": "^7.10", + "nunomaduro/larastan": "^2.8", + "orchestra/testbench": "^8.21", + "pestphp/pest": "^2.3", + "pestphp/pest-plugin-laravel": "^2.2", + "pestphp/pest-plugin-arch": "^2.6", + "phpstan/extension-installer": "^1.3", + "phpstan/phpstan-deprecation-rules": "^1.1", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^10.5", + "spatie/laravel-ray": "^1.35" }, "autoload": { "psr-4": { diff --git a/src/Client/PostfinanceClientFactory.php b/src/Client/PostfinanceClientFactory.php index 0e55445..bf73a3c 100644 --- a/src/Client/PostfinanceClientFactory.php +++ b/src/Client/PostfinanceClientFactory.php @@ -12,7 +12,6 @@ use Phpro\SoapClient\Caller\EngineCaller; use Phpro\SoapClient\Caller\EventDispatchingCaller; use Phpro\SoapClient\Soap\DefaultEngineFactory; -use function Psl\invariant; use Soap\ExtSoapEngine\ExtSoapOptions; use Soap\Psr18Transport\Middleware\RemoveEmptyNodesMiddleware; use Soap\Psr18Transport\Psr18Transport; @@ -21,6 +20,8 @@ use Soap\Psr18WsseMiddleware\WsseMiddleware; use Symfony\Component\EventDispatcher\EventDispatcher; +use function Psl\invariant; + class PostfinanceClientFactory { /** diff --git a/tests/Feature/GetInvoiceListPayerTest.php b/tests/Feature/GetInvoiceListPayerTest.php index ca7d9e5..3218a07 100644 --- a/tests/Feature/GetInvoiceListPayerTest.php +++ b/tests/Feature/GetInvoiceListPayerTest.php @@ -12,5 +12,4 @@ $response = $client->getInvoiceListPayer(new GetInvoiceListPayer($payerId, false)); expect($response->getGetInvoiceListPayerResult()->getInvoiceReport())->toBeIterable(); -}) - ->group('get', 'test'); +})->group('get', 'test'); diff --git a/tests/Feature/GetInvoicePayerTest.php b/tests/Feature/GetInvoicePayerTest.php index 2fc2b25..5946abd 100644 --- a/tests/Feature/GetInvoicePayerTest.php +++ b/tests/Feature/GetInvoicePayerTest.php @@ -18,5 +18,4 @@ $response = $client->getInvoicePayer(new GetInvoicePayer($payerId, $billerId, $transactionId, $fileType)); expect($response->getGetInvoicePayerResult()->getData())->toBeString()->not()->toBeEmpty(); -}) - ->group('get', 'test'); +})->group('get', 'test'); diff --git a/tests/Feature/PingTest.php b/tests/Feature/PingTest.php index aa361a1..89d4089 100644 --- a/tests/Feature/PingTest.php +++ b/tests/Feature/PingTest.php @@ -11,7 +11,6 @@ $client = PostfinanceClientFactory::factory($config); $response = $client->executePing(new ExecutePing(null, $payerId, null, null)); - expect($response->getExecutePingResult())->toBeNumeric(); -}) - ->group('get', 'test'); + expect($response->getExecutePingResult())->toBeNumeric(); +})->group('get', 'test'); From b3203ee60a6a16b5083bcc7fc6af4d35425ed784 Mon Sep 17 00:00:00 2001 From: Rhys Lees <43909932+RhysLees@users.noreply.github.com> Date: Wed, 21 Feb 2024 19:26:21 +0000 Subject: [PATCH 02/14] WIP --- .github/ISSUE_TEMPLATE/bug_report.yml | 51 ++++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 11 ----- .github/ISSUE_TEMPLATE/feature_request.yml | 12 +++++ .phpunit.cache/test-results | 1 + 4 files changed, 64 insertions(+), 11 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml delete mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml create mode 100644 .phpunit.cache/test-results diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..7546b77 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,51 @@ +name: Bug Report +description: Report an Issue or Bug with the Package +title: "[Bug]: " +labels: ["bug"] +body: + - type: markdown + attributes: + value: | + We're sorry to hear you have a problem. Can you help us solve it by providing the following details. + - type: textarea + id: what-happened + attributes: + label: What happened? + description: What did you expect to happen? + placeholder: I cannot currently do X thing because when I do, it breaks X thing. + validations: + required: true + - type: input + id: package-version + attributes: + label: Package Version + description: What version of our Package are you running? Please be as specific as possible + placeholder: 1.0.0 + validations: + required: true + - type: input + id: php-version + attributes: + label: PHP Version + description: What version of PHP are you running? Please be as specific as possible + placeholder: 8.3.0 + validations: + required: true + - type: input + id: laravel-version + attributes: + label: Laravel Version + description: What version of Laravel are you running? Please be as specific as possible + placeholder: 11.0.0 + validations: + required: true + - type: dropdown + id: operating-systems + attributes: + label: Which operating systems does with happen with? + description: You may select more than one. + multiple: true + options: + - macOS + - Windows + - Linux diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index b4e8146..0000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,11 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: Ask a question - url: https://github.com/codebar-ag/laravel-flatfox/discussions/new?category=q-a - about: Ask the community for help - - name: Request a feature - url: https://github.com/codebar-ag/laravel-flatfox/discussions/new?category=ideas - about: Share ideas for new features - - name: Report a bug - url: https://github.com/codebar-ag/laravel-flatfox/issues/new - about: Report a reproducable bug diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..b259caf --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,12 @@ +name: Question or Feature +description: Open a Question or Feature Request +title: "[Feature]: " +labels: ["feature"] +body: + - type: textarea + id: question-feature + attributes: + label: Question or Feature? + description: Enter a Question or Feature Request + validations: + required: true diff --git a/.phpunit.cache/test-results b/.phpunit.cache/test-results new file mode 100644 index 0000000..3ed6576 --- /dev/null +++ b/.phpunit.cache/test-results @@ -0,0 +1 @@ +{"version":"pest_2.33.4","defects":{"P\\Tests\\Feature\\GetInvoicePayerTest::__pest_evaluable_it_b2b_service_getInvoicePayer_test":7},"times":{"P\\Tests\\Feature\\PingTest::__pest_evaluable_it_b2b_service_executePing_test":0.381,"P\\Tests\\Feature\\GetInvoiceListPayerTest::__pest_evaluable_it_b2b_service_getInvoiceListPayer_test":0.679,"P\\Tests\\Feature\\GetInvoicePayerTest::__pest_evaluable_it_b2b_service_getInvoicePayer_test":0.43}} \ No newline at end of file From 502f2cde9dbb8787c02060dea1b594033f65ef03 Mon Sep 17 00:00:00 2001 From: Rhys Lees <43909932+RhysLees@users.noreply.github.com> Date: Wed, 21 Feb 2024 19:52:11 +0000 Subject: [PATCH 03/14] WIP --- .github/workflows/phpstan.yml | 2 +- .github/workflows/run-tests.yml | 2 +- composer.json | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 557d263..3c93dae 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -16,7 +16,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' coverage: none - name: Install composer dependencies diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index bff3889..e04b94f 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,7 +14,7 @@ jobs: matrix: # os: [ ubuntu-latest, windows-latest ] os: [ ubuntu-latest ] - php: [ 8.1 ] + php: [ 8.2 ] laravel: [ 9.* ] #stability: [ prefer-lowest, prefer-stable ] stability: [ prefer-stable ] diff --git a/composer.json b/composer.json index db13cc9..803f70c 100644 --- a/composer.json +++ b/composer.json @@ -37,8 +37,8 @@ "nunomaduro/collision": "^7.0", "nunomaduro/larastan": "^2.4.0", "orchestra/testbench": "^8.0", - "pestphp/pest": "2.x-dev", - "pestphp/pest-plugin-laravel": "2.x-dev", + "pestphp/pest": "^2.0", + "pestphp/pest-plugin-laravel": "^2.0", "phpstan/extension-installer": "^1.1", "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-phpunit": "^1.0", From 82903a4d01b3ce38ce70a7ad53d49981ad830e75 Mon Sep 17 00:00:00 2001 From: Rhys Lees <43909932+RhysLees@users.noreply.github.com> Date: Wed, 21 Feb 2024 21:34:09 +0000 Subject: [PATCH 04/14] WIP --- .github/workflows/run-tests.yml | 6 +++--- .phpunit.cache/test-results | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index e04b94f..b1840a2 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -15,12 +15,12 @@ jobs: # os: [ ubuntu-latest, windows-latest ] os: [ ubuntu-latest ] php: [ 8.2 ] - laravel: [ 9.* ] + laravel: [ 10.* ] #stability: [ prefer-lowest, prefer-stable ] stability: [ prefer-stable ] include: - - laravel: 9.* - testbench: 7.* + - laravel: 10.* + testbench: 9.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} diff --git a/.phpunit.cache/test-results b/.phpunit.cache/test-results index 3ed6576..7f2fc30 100644 --- a/.phpunit.cache/test-results +++ b/.phpunit.cache/test-results @@ -1 +1 @@ -{"version":"pest_2.33.4","defects":{"P\\Tests\\Feature\\GetInvoicePayerTest::__pest_evaluable_it_b2b_service_getInvoicePayer_test":7},"times":{"P\\Tests\\Feature\\PingTest::__pest_evaluable_it_b2b_service_executePing_test":0.381,"P\\Tests\\Feature\\GetInvoiceListPayerTest::__pest_evaluable_it_b2b_service_getInvoiceListPayer_test":0.679,"P\\Tests\\Feature\\GetInvoicePayerTest::__pest_evaluable_it_b2b_service_getInvoicePayer_test":0.43}} \ No newline at end of file +{"version":"pest_2.34.0","defects":{"P\\Tests\\Feature\\GetInvoicePayerTest::__pest_evaluable_it_b2b_service_getInvoicePayer_test":7},"times":{"P\\Tests\\Feature\\GetInvoicePayerTest::__pest_evaluable_it_b2b_service_getInvoicePayer_test":0.542,"P\\Tests\\Feature\\GetInvoiceListPayerTest::__pest_evaluable_it_b2b_service_getInvoiceListPayer_test":0.405,"P\\Tests\\Feature\\PingTest::__pest_evaluable_it_b2b_service_executePing_test":0.408}} \ No newline at end of file From 2604b985e4457c93b0ca46f6d8b062ef81d7cf01 Mon Sep 17 00:00:00 2001 From: Rhys Lees <43909932+RhysLees@users.noreply.github.com> Date: Wed, 21 Feb 2024 21:35:31 +0000 Subject: [PATCH 05/14] WIP --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index b1840a2..9f9a31c 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -20,7 +20,7 @@ jobs: stability: [ prefer-stable ] include: - laravel: 10.* - testbench: 9.* + testbench: 8.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} From 79ab7faa0aab8b3359b0faf58f2b24f2eaf43e18 Mon Sep 17 00:00:00 2001 From: Rhys Lees <43909932+RhysLees@users.noreply.github.com> Date: Thu, 14 Mar 2024 21:21:29 +0000 Subject: [PATCH 06/14] WIP --- composer.json | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/composer.json b/composer.json index db13cc9..a617a41 100644 --- a/composer.json +++ b/composer.json @@ -22,28 +22,28 @@ "php": "^8.2", "ext-soap": "*", "ext-xsl": "*", - "guzzlehttp/guzzle": "^7.5", - "illuminate/contracts": "^10.0", + "guzzlehttp/guzzle": "^7.8", + "illuminate/contracts": "^11.0", "monolog/monolog": "^3.5", "nyholm/psr7": "^1.8", "php-http/logger-plugin": "^1.3", "php-soap/psr18-wsse-middleware": "^2.3", "phpro/soap-client": "^3.1", - "spatie/laravel-package-tools": "^1.9.2", - "symfony/http-client": "^6.2" + "spatie/laravel-package-tools": "^1.16", + "symfony/http-client": "^6.4" }, "require-dev": { - "laravel/pint": "^1.5", - "nunomaduro/collision": "^7.0", - "nunomaduro/larastan": "^2.4.0", - "orchestra/testbench": "^8.0", - "pestphp/pest": "2.x-dev", - "pestphp/pest-plugin-laravel": "2.x-dev", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^10.0", - "spatie/laravel-ray": "^1.9" + "laravel/pint": "^1.14", + "nunomaduro/collision": "^8.1", + "larastan/larastan": "^2.9", + "orchestra/testbench": "^9.1", + "pestphp/pest": "^2.0", + "pestphp/pest-plugin-laravel": "^2.3", + "phpstan/extension-installer": "^1.3", + "phpstan/phpstan-deprecation-rules": "^1.1", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^10.5", + "spatie/laravel-ray": "^1.35" }, "autoload": { "psr-4": { From 588202de1e7f76bb2bb9803c6724a5dec60a8085 Mon Sep 17 00:00:00 2001 From: Rhys Lees <43909932+RhysLees@users.noreply.github.com> Date: Thu, 14 Mar 2024 22:06:09 +0000 Subject: [PATCH 07/14] WIP --- .github/workflows/run-tests.yml | 8 ++++---- composer.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index bff3889..334c9e9 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,13 +14,13 @@ jobs: matrix: # os: [ ubuntu-latest, windows-latest ] os: [ ubuntu-latest ] - php: [ 8.1 ] - laravel: [ 9.* ] + php: [ 8.3 ] + laravel: [ 11.* ] #stability: [ prefer-lowest, prefer-stable ] stability: [ prefer-stable ] include: - - laravel: 9.* - testbench: 7.* + - laravel: 11.* + testbench: 9.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} diff --git a/composer.json b/composer.json index a617a41..6a759e5 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ } ], "require": { - "php": "^8.2", + "php": "^8.3", "ext-soap": "*", "ext-xsl": "*", "guzzlehttp/guzzle": "^7.8", From 2532f2b3ff6f68695947a4c8ff0b3dfd5d2c1b6e Mon Sep 17 00:00:00 2001 From: Rhys Lees <43909932+RhysLees@users.noreply.github.com> Date: Thu, 14 Mar 2024 22:24:59 +0000 Subject: [PATCH 08/14] WIP --- .github/workflows/run-tests.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 334c9e9..f3aca48 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -18,9 +18,6 @@ jobs: laravel: [ 11.* ] #stability: [ prefer-lowest, prefer-stable ] stability: [ prefer-stable ] - include: - - laravel: 11.* - testbench: 9.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} From ac70a0f3cec5c2c267978b1da3ea22714fa42672 Mon Sep 17 00:00:00 2001 From: Rhys Lees <43909932+RhysLees@users.noreply.github.com> Date: Thu, 14 Mar 2024 22:27:02 +0000 Subject: [PATCH 09/14] WIP --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index f3aca48..35fbd1a 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -39,7 +39,7 @@ jobs: - name: Install dependencies run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update composer update --${{ matrix.stability }} --prefer-dist --no-interaction - name: Execute tests From 53492966ce7d8b709c2c93f0ebf90fa887a619cd Mon Sep 17 00:00:00 2001 From: Rhys Lees <43909932+RhysLees@users.noreply.github.com> Date: Thu, 14 Mar 2024 22:29:11 +0000 Subject: [PATCH 10/14] WIP --- src/Client/PostfinanceClientFactory.php | 3 ++- tests/Feature/PingTest.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Client/PostfinanceClientFactory.php b/src/Client/PostfinanceClientFactory.php index 0e55445..bf73a3c 100644 --- a/src/Client/PostfinanceClientFactory.php +++ b/src/Client/PostfinanceClientFactory.php @@ -12,7 +12,6 @@ use Phpro\SoapClient\Caller\EngineCaller; use Phpro\SoapClient\Caller\EventDispatchingCaller; use Phpro\SoapClient\Soap\DefaultEngineFactory; -use function Psl\invariant; use Soap\ExtSoapEngine\ExtSoapOptions; use Soap\Psr18Transport\Middleware\RemoveEmptyNodesMiddleware; use Soap\Psr18Transport\Psr18Transport; @@ -21,6 +20,8 @@ use Soap\Psr18WsseMiddleware\WsseMiddleware; use Symfony\Component\EventDispatcher\EventDispatcher; +use function Psl\invariant; + class PostfinanceClientFactory { /** diff --git a/tests/Feature/PingTest.php b/tests/Feature/PingTest.php index aa361a1..42b99fa 100644 --- a/tests/Feature/PingTest.php +++ b/tests/Feature/PingTest.php @@ -1,7 +1,7 @@ Date: Fri, 15 Mar 2024 11:24:49 +0000 Subject: [PATCH 11/14] WIP --- .phpunit.cache/test-results | 1 + 1 file changed, 1 insertion(+) create mode 100644 .phpunit.cache/test-results diff --git a/.phpunit.cache/test-results b/.phpunit.cache/test-results new file mode 100644 index 0000000..6df30fb --- /dev/null +++ b/.phpunit.cache/test-results @@ -0,0 +1 @@ +{"version":"pest_2.34.4","defects":{"P\\Tests\\Feature\\GetInvoicePayerTest::__pest_evaluable_it_b2b_service_getInvoicePayer_test":7},"times":{"P\\Tests\\Feature\\PingTest::__pest_evaluable_it_b2b_service_executePing_test":0.575,"P\\Tests\\Feature\\GetInvoicePayerTest::__pest_evaluable_it_b2b_service_getInvoicePayer_test":0.462,"P\\Tests\\Feature\\GetInvoiceListPayerTest::__pest_evaluable_it_b2b_service_getInvoiceListPayer_test":0.463}} \ No newline at end of file From 6d29bea28ed7d27993a1e62aa85c64de050b54c2 Mon Sep 17 00:00:00 2001 From: Rhys Lees <43909932+RhysLees@users.noreply.github.com> Date: Fri, 15 Mar 2024 12:08:20 +0000 Subject: [PATCH 12/14] WIP --- .github/workflows/phpstan.yml | 2 +- .github/workflows/run-tests.yml | 2 +- composer.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 557d263..3c93dae 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -16,7 +16,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' coverage: none - name: Install composer dependencies diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 35fbd1a..8df08d5 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,7 +14,7 @@ jobs: matrix: # os: [ ubuntu-latest, windows-latest ] os: [ ubuntu-latest ] - php: [ 8.3 ] + php: [ 8.2, 8.3 ] laravel: [ 11.* ] #stability: [ prefer-lowest, prefer-stable ] stability: [ prefer-stable ] diff --git a/composer.json b/composer.json index 6a759e5..d96e4c6 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ } ], "require": { - "php": "^8.3", + "php": ">=8.2", "ext-soap": "*", "ext-xsl": "*", "guzzlehttp/guzzle": "^7.8", From 332837593efe4a0ddc04a021453dbd1c4550edd4 Mon Sep 17 00:00:00 2001 From: Sebastian Fix Date: Thu, 12 Sep 2024 23:57:29 +0200 Subject: [PATCH 13/14] WIP --- src/Client/PostfinanceClientFactory.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Client/PostfinanceClientFactory.php b/src/Client/PostfinanceClientFactory.php index bf73a3c..5bf1b14 100644 --- a/src/Client/PostfinanceClientFactory.php +++ b/src/Client/PostfinanceClientFactory.php @@ -68,6 +68,8 @@ public static function factory(array $config): PostfinanceClient ) ); + ray($engine); + $eventDispatcher = new EventDispatcher(); $caller = new EventDispatchingCaller(new EngineCaller($engine), $eventDispatcher); From b7ed47b7727d0ed7fb373fe3fe19b226cfacb123 Mon Sep 17 00:00:00 2001 From: StanBarrows Date: Thu, 12 Sep 2024 21:57:53 +0000 Subject: [PATCH 14/14] Fix styling --- src/Client/PostfinanceClientFactory.php | 8 ++++---- src/PostfinanceB2B.php | 4 +--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Client/PostfinanceClientFactory.php b/src/Client/PostfinanceClientFactory.php index 5bf1b14..0098868 100644 --- a/src/Client/PostfinanceClientFactory.php +++ b/src/Client/PostfinanceClientFactory.php @@ -46,7 +46,7 @@ public static function factory(array $config): PostfinanceClient new HeaderDefaultsPlugin([ 'User-Agent' => 'Laravel PostFinance B2B', ]), - new RemoveEmptyNodesMiddleware(), + new RemoveEmptyNodesMiddleware, new WsseMiddleware( outgoing: [ (new Entry\Username($config['username'])) @@ -54,7 +54,7 @@ public static function factory(array $config): PostfinanceClient ->withDigest(false), ] ), - new WsaMiddleware2005(), + new WsaMiddleware2005, ...($config['debug'] ? [ new LoggerPlugin( (new Logger('http'))->pushHandler( @@ -68,9 +68,9 @@ public static function factory(array $config): PostfinanceClient ) ); - ray($engine); + ray($engine); - $eventDispatcher = new EventDispatcher(); + $eventDispatcher = new EventDispatcher; $caller = new EventDispatchingCaller(new EngineCaller($engine), $eventDispatcher); return new PostfinanceClient($caller); diff --git a/src/PostfinanceB2B.php b/src/PostfinanceB2B.php index 3cc5da9..6c10a77 100644 --- a/src/PostfinanceB2B.php +++ b/src/PostfinanceB2B.php @@ -2,6 +2,4 @@ namespace CodebarAg\PostfinanceB2B; -class PostfinanceB2B -{ -} +class PostfinanceB2B {}