CallbackHandler: capture optional headers in handleRaw(), add handleGlobals() - #17
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 1.x #17 +/- ##
============================================
+ Coverage 99.03% 99.06% +0.03%
- Complexity 192 197 +5
============================================
Files 26 26
Lines 517 535 +18
============================================
+ Hits 512 530 +18
Misses 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
loevgaard
force-pushed
the
dx/handle-globals
branch
from
August 17, 2026 11:14
b63f64a to
a8f61fe
Compare
…lobals() handleRaw() is what most integrations actually use — Symfony and Laravel requests aren't PSR-7 without a bridge — but it could not populate Callback::$accountId / $apiVersion, and plain-PHP endpoints had to hand-roll the php://input + $_SERVER dance (which examples/e2e/listen.php did). - handleRaw($rawBody, $checksum, $resourceType, ?$accountId = null, ?$apiVersion = null) — additive optional params; empty strings → null, consistent with handle(). - handleGlobals(?$rawBody = null, ?array $server = null) — reads php://input and HTTP_QUICKPAY_* from $_SERVER (injectable for tests; non-string superglobal values are cast). - Class docblock lists the three entry points; the e2e listener now uses handleGlobals() and Callback::$accountId. - README: Symfony / Laravel / plain-PHP callback snippets. Refs #10 (finding 8).
loevgaard
force-pushed
the
dx/handle-globals
branch
from
August 17, 2026 11:25
a8f61fe to
1300c19
Compare
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.
Part of #10 (finding 8).
Why
handleRaw()is what most integrations actually use — Symfony and Laravel requests aren't PSR-7 without a bridge — but it could not populateCallback::$accountId/$apiVersion, and plain-PHP endpoints had to hand-roll thephp://input+$_SERVERdance (whichexamples/e2e/listen.phpdid, line for line).What
handleRaw(string $rawBody, string $checksum, string $resourceType, ?string $accountId = null, ?string $apiVersion = null)— additive optional params; empty strings normalize tonull, consistent withhandle().handleGlobals(?string $rawBody = null, ?array $server = null): Callback— readsphp://inputandHTTP_QUICKPAY_*from$_SERVER(both injectable for tests; non-string superglobal values are cast). Same verification path as the other two entry points.handle()PSR-7 /handleRaw()framework /handleGlobals()plain PHP); the e2e listener useshandleGlobals()andCallback::$accountId.getContent()is raw in both frameworks).Purely additive. Tests:
handleRaw()with/without the optional headers,handleGlobals()happy path (incl. an int header value), bad/missing checksum, missing resource type, absent optional headers, and the real-superglobal default path.