Skip to content

Replace payum's plain-PHP GetHttpRequest action with the header-aware one by default - #78

Merged
loevgaard merged 1 commit into
2.xfrom
feat/auto-header-aware-get-http-request
Aug 17, 2026
Merged

Replace payum's plain-PHP GetHttpRequest action with the header-aware one by default#78
loevgaard merged 1 commit into
2.xfrom
feat/auto-header-aware-get-http-request

Conversation

@loevgaard

Copy link
Copy Markdown
Member

Implements A3 of #71 (marked optional there — this is the proposal; small and self-contained, easy to drop if you'd rather keep it explicit).

NotifyAction reads QuickPay-Checksum-Sha256 off GetHttpRequest::$headers, and among payum/core's own bridges only the Symfony one sets it. Payum's core config puts its plain-PHP GetHttpRequestAction in place before populateConfig() runs, so a plain-PHP Payum that did not know to swap in HeaderAwareGetHttpRequestAction (#64) rejected every callback as unsigned, 400, silently, for every payment. The README said so; nothing enforced it.

QuickpayGatewayFactory::populateConfig() now replaces payum.action.get_http_request with HeaderAwareGetHttpRequestAction when — and only when — the configured value is payum's exact plain-PHP class:

  • PayumBundle's Symfony bridge (a different class) is left alone → Sylius/Symfony unaffected;
  • anything a consumer configured deliberately — a subclass of payum's action, another action, the header-aware one already — is left alone (tested per case);
  • what is swapped is the one value nobody chose.

A real-gateway test executes GetHttpRequest through the factory-built gateway with $_SERVER['HTTP_QUICKPAY_CHECKSUM_SHA256'] set and reads the header back. README (Callbacks), docs/UPGRADE-2.0.md and CLAUDE.md updated; the e2e harness keeps its explicit registration as the reference for consumers wiring their own (comment says it is now redundant).

composer all and the dependency analyser green (322 tests).

@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.43%. Comparing base (ef3db7f) to head (cc335de).
⚠️ Report is 2 commits behind head on 2.x.

Additional details and impacted files
@@             Coverage Diff              @@
##                2.x      #78      +/-   ##
============================================
+ Coverage     98.41%   98.43%   +0.01%     
- Complexity      202      206       +4     
============================================
  Files            19       19              
  Lines           506      512       +6     
============================================
+ Hits            498      504       +6     
  Misses            8        8              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

… one by default

NotifyAction reads the QuickPay-Checksum-Sha256 header off
GetHttpRequest::$headers, and among payum/core's own bridges only the
Symfony one sets that property. Payum's core config puts its plain-PHP
GetHttpRequestAction in place before this factory runs, so a plain-PHP
Payum that did not know to swap in HeaderAwareGetHttpRequestAction
rejected EVERY callback as unsigned, with a 400, silently — for every
payment. The README told you; nothing enforced it.

QuickpayGatewayFactory::populateConfig() now replaces the configured
payum.action.get_http_request with HeaderAwareGetHttpRequestAction when
— and only when — it is payum's exact plain-PHP class: the Symfony bridge
(a different class, wired by PayumBundle/Sylius) is left alone, and so
is anything a consumer configured deliberately (a subclass, another
action). What is swapped is the one value nobody chose. Registering the
header-aware action yourself keeps working and is now redundant.

Refs #71 (A3).
@loevgaard

Copy link
Copy Markdown
Member Author

Rebased onto 2.x (README and a test import conflicted with #72/#76); no functional change. Merging once CI is green.

@loevgaard
loevgaard force-pushed the feat/auto-header-aware-get-http-request branch from 3a3aa04 to cc335de Compare August 17, 2026 09:43
@loevgaard
loevgaard merged commit fbfaa0a into 2.x Aug 17, 2026
21 checks passed
@loevgaard
loevgaard deleted the feat/auto-header-aware-get-http-request branch August 17, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant