Repository navigation
Decide the pending state from what already happened to the money - #81
Merged
Merged
Conversation
Quickpay's `pending` is not only an authorize held up in 3-D Secure: it is the payment's state whenever an operation is in flight, including an asynchronous capture, refund or cancel on a payment that already has money captured or held. Verified live (2026-08-17): a captured payment read `pending` — with the pre-operation balance — for the ~second its refund took to settle. StatusAction mapped that state straight to markPending(), so a captured payment reported pending mid-refund and an authorized one pending while its capture was queued. An operation in flight never changes what already happened, so `pending` now decides like `processed`: from the last APPROVED operation (authorized / captured / refunded-by-balance / canceled), via the shared markFromLastApprovedOperation(). Only a payment with nothing approved yet is genuinely pending. Refs #71 (R4).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 2.x #81 +/- ##
============================================
+ Coverage 98.40% 98.42% +0.02%
- Complexity 199 203 +4
============================================
Files 19 19
Lines 501 508 +7
============================================
+ Hits 493 500 +7
Misses 8 8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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 R4 of #71 — now verified live.
Quickpay's
pendingis not only an authorize held up in 3-D Secure: it is the payment's state whenever an operation is in flight, including an asynchronous capture/refund/cancel on a payment that already has money captured or held. Verified today with a 50 ms poll around an async refund of a captured payment:StatusActionmapped that state straight tomarkPending(), so a captured payment reportedpendingmid-refund, and an authorized onependingwhile its (auto-)capture was queued — the window is short, but it is exactly when aGetStatusright after issuing an operation lands.An operation in flight never changes what already happened, so
pendingnow decides likeprocessed: from the last approved operation (authorized/captured/ refund-by-balance /canceled), through a sharedmarkFromLastApprovedOperation(). Only a payment with nothing approved yet — no operations, an authorize in 3-D Secure, a declined attempt with a retry in flight — is genuinelypending. Tests for both groups; README,docs/UPGRADE-2.0.mdand CLAUDE.md updated.composer allgreen (352 tests).