Repository navigation
Support PHP 8 (installable on patched PHP 8.2.35+ releases) - #9
Closed
JulesNsenda wants to merge 3 commits into
Closed
JulesNsenda wants to merge 3 commits into
JulesNsenda wants to merge 3 commits into
Conversation
composer.json only allowed PHP 7.x, so the package could not be installed on any PHP release from the 21 Oct 2026 security update (8.2.35, 8.3.36, 8.4.27, 8.5.12). - Allow "^7.2 || ^8.0". The floor moves to 7.2 because the explicit nullable type and omnipay/tests ^4.1 need it; projects on 7.0/7.1 stay on the previous release. - Make sendRequest()'s $data explicitly nullable (implicit nullable types are deprecated in PHP 8.4). - Guard response getters against missing keys so error and partial payloads don't raise "Undefined array key" warnings on PHP 8. Return values are unchanged. - Cast the transaction reference before rawurlencode() (passing null is deprecated in PHP 8.1). - omnipay/tests ~3.0 -> ^4.1 (PHPUnit 8.5-11), setUp(): void, and a phpunit.xml.dist those versions all accept. - Drop phpro/grumphp: 0.14 only installs with Composer 1 and current releases need PHP 8.2+. - Disallow the php-http/discovery Composer plugin; it isn't needed. - Add tests for completePurchase() (success, declined, unknown reference, no reference, partial payload) and for failed purchase and refund responses, with the previously empty failure mocks filled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Travis CI no longer runs for this repo. The new workflow tests PHP 7.2-8.5 with highest dependencies, plus lowest dependencies on 7.2 and 8.5. On PHPUnit 10+ it fails on PHP deprecations, warnings and notices, which PHPUnit otherwise only reports. Actions are pinned to commit SHAs, the checkout doesn't persist credentials, and the job token is read-only. Scrutinizer's external_code_coverage is removed: coverage was uploaded from Travis, so inspections would wait for it and time out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jules-paystack
approved these changes
Oct 26, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #8
composer.jsonrequired"php": "^7.0", so this package couldn't be installed on any PHP release from the 21 Oct 2026 security update for critical remote code execution flaws (GHSA-w8hw-w9fx-j79w, GHSA-6wmf-4rv5-p3rp; php.net). The fixed releases are 8.2.35, 8.3.36, 8.4.27 and 8.5.12. PHP 7.x no longer gets security fixes.Changes
Support PHP 8
"php": "^7.0"→"^7.2 || ^8.0". The floor moves to 7.2 because the explicit nullable type below andomnipay/tests ^4.1need it. Composer keeps projects on 7.0/7.1 on the current release.sendRequest(..., ?array $data = null): implicit nullable types are deprecated in PHP 8.4.?? null/!empty()/isset()). Return values are unchanged.completePurchase()casts the reference beforerawurlencode(), because passingnullis deprecated in PHP 8.1.omnipay/tests ~3.0→^4.1(PHPUnit 8.5–11),setUp(): void, and aphpunit.xml.distthat PHPUnit 8–11 all accept.phpro/grumphp: 0.14 only installs with Composer 1, and current releases need PHP 8.2+.config.allow-plugins:php-http/discoverydisabled, because nothing here needs it.completePurchase()success, declined, unknown reference, no reference and partial payload, plus failed purchase and failed refund. The previously empty failure mocks are filled in. 31 → 39 tests.CI
--fail-on-deprecation --fail-on-warning --fail-on-notice. Without these flags PHPUnit only reports PHP deprecations, so CI wouldn't catch a regression like the 8.4 one fixed here.persist-credentials: false, and the token iscontents: read.external_code_coverage, because coverage came from Travis.Docs: README requirement and CHANGELOG.
How it was verified
I tested this locally in Docker, using official
php:*-cliimages and Composer resolving for each exact version:array $data = nullput back, PHP 8.4.27 + PHPUnit 11 exits 1 with the strict flags and 0 without them. So the strict CI flags do catch it.composer require league/omnipay:^3 php-http/guzzle7-adapter paystackhq/omnipay-paystackfrom this branch. It then calledpurchase(),completePurchase()andrefund()against the realapi.paystack.cowith a fake key. All three returned the right response classes with Paystack'sInvalid keymessage, and the package raised no PHP warnings or deprecations (an error handler failed the run on any).The three skipped tests (
AuthorizeRequestTest,ResponseTest) were already marked "Must be revisited" and are unchanged apart fromsetUp(): void.Related, not in this PR
CompletePurchaseResponse::isSuccessful()only checksdata.status === 'success'. Callers who verify a payment should also comparedata.amountanddata.currencyagainst the order. Otherwise a successful payment of a smaller amount, or a reused reference, could be accepted. This behaviour predates the PR and is worth tracking separately.🤖 Generated with Claude Code