Ship HeaderAwareGetHttpRequestAction in the package - #64
Open
loevgaard wants to merge 1 commit into
Open
Conversation
payum/core's plain-PHP GetHttpRequest bridge never populates the headers property, and NotifyAction reads the QuickPay-Checksum-Sha256 header off exactly that property — so on a plain-PHP Payum every callback was rejected as unsigned with a 400, silently, for every payment, unless the consumer found and copied the class hidden in examples/e2e/. The action now lives in the package proper (Setono\Payum\Quickpay\Bridge\PlainPhp\Action) with a registration snippet in its docblock and the upgrade guide; the e2e harness uses the shipped class and its local copy is gone. Headers from getallheaders() (real or polyfilled — guzzle ships one that passes $_SERVER values through untouched) and from the $_SERVER fallback are sanitized the same way, so the result is deterministic across SAPIs. GetHttpRequest is declared a universalObjectCratesClass for PHPStan: headers is a dynamic property (payum marks the class AllowDynamicProperties), and this is PHPStan's documented way to accept that contract.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 2.x #64 +/- ##
============================================
- Coverage 97.43% 95.46% -1.97%
- Complexity 126 138 +12
============================================
Files 14 15 +1
Lines 351 375 +24
============================================
+ Hits 342 358 +16
- Misses 9 17 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Aug 10, 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 gap G2 of #57.
Problem
payum/core's plain-PHP
GetHttpRequestbridge never populatesGetHttpRequest::$headers, andNotifyActionreads theQuickPay-Checksum-Sha256header off exactly that property. So on a plain-PHP Payum every callback is rejected as unsigned (400) — silently, for every payment — unless the consumer found and copied the helper class hidden inexamples/e2e/. That's a total failure of the notify path for a whole class of consumers, shipped as dev tooling.Fix
Setono\Payum\Quickpay\Bridge\PlainPhp\Action\HeaderAwareGetHttpRequestAction, with the registration snippet (addCoreGatewayFactoryConfig(['payum.action.get_http_request' => …])) in its docblock and indocs/UPGRADE-2.0.md. It is not auto-registered: the core gateway factory already defines that key, so a default could never take effect, and force-setting it would stomp the Symfony bridge for Symfony/Sylius consumers who don't need this.getallheaders()(the SAPI's own or a polyfill — guzzle shipsralouphie/getallheaders, which passes$_SERVERvalues through untouched) and from the$_SERVERfallback are sanitized identically (string names, scalar values, everything else dropped), so the result is deterministic across SAPIs.GetHttpRequestis declared auniversalObjectCratesClassfor PHPStan —headersis a dynamic property (payum marks the class#[AllowDynamicProperties]), and this is PHPStan's documented way to accept that contract.The README section pointing plain-PHP consumers at this class comes in the follow-up docs PR, which is stacked on this one.
Tests
New
HeaderAwareGetHttpRequestActionTest: headers populated alongside the parent's fields, the reconstructed checksum-header name is findable byNotifyAction's case-insensitive match, and non-header / non-scalar$_SERVERentries are dropped.