Repository navigation
Model how an operation's callback was answered on Operation - #33
Merged
Merged
Conversation
Quickpay records on every operation how its callback was answered: callback_success, callback_response_code, callback_at and callback_duration. Only callback_url was typed, so consumers read the rest from the payment's raw operations. The types are the ones the live API returns (verified against the test account's payments); the new constructor parameters come last.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 1.x #33 +/- ##
=========================================
Coverage 99.17% 99.17%
Complexity 230 230
=========================================
Files 28 28
Lines 605 605
=========================================
Hits 600 600
Misses 5 5 ☔ 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.
Summary
Quickpay records on every operation how its callback was answered. Only
callback_urlwas typed, so consumers read the rest from the payment's$raw['operations'](SyliusQuickpayPlugin#135 does, to show each operation's callback outcome in the admin).final class Operation { public function __construct( ... public readonly ?string $callbackUrl = null, public readonly ?\DateTimeImmutable $createdAt = null, + public readonly ?bool $callbackSuccess = null, // Quickpay's judgment of the answer + public readonly ?string $callbackResponseCode = null, // e.g. "204"; null when no answer came + public readonly ?\DateTimeImmutable $callbackAt = null, // when it was sent + public readonly ?int $callbackDuration = null, // ms; null when unreachable ) {All four are
nulluntil the callback was sent. README (Reading what happened to a payment) and the changelog say so.Evidence
Types as the live API returns them, from the test account's 40 latest payments:
callback_successcallback_response_codecallback_atcallback_durationtrue"204""2026-11-16T11:23:57Z"804false"404""2026-11-03T13:01:38Z"51falsenull(unreachable)"2026-11-17T09:26:57Z"nullnullnullnullnullA timed-out callback reports
callback_duration: 30002with no response code (quickpay-dotnet-client#22), hence?int.PaymentsEndpointTest::it_maps_nested_link_operations_and_metadataassertingoperations[0]->callbackSuccess === truefails: the property doesn't exist.After: it passes for an answered callback (
true,"200", time,804) and an unanswered one (false,null, time,null); thepayment.jsonfixture carries both shapes. Full suite, PHPStan, ECS and Rector green.Merge Danger
Door: two-way until released, one-way after
Once tagged, removing a property is a BC break.
Blast Radius: mapping
Valinor maps a payment strictly, so a nested field typed wrong fails every payment read, not just this field. The types match 59 live operations of all four shapes; a value of another type from Quickpay (say a float duration) would break
getById()and callbacks'payment().