Small additive DX items: variables(), deadlineAt/acquirer, Shopsystem, memoized callback payment, SDK version in User-Agent - #19
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 1.x #19 +/- ##
============================================
+ Coverage 99.06% 99.08% +0.01%
- Complexity 197 203 +6
============================================
Files 26 27 +1
Lines 535 544 +9
============================================
+ Hits 530 539 +9
Misses 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
loevgaard
force-pushed
the
dx/small-additive
branch
from
August 17, 2026 09:40
3c79da4 to
bca4048
Compare
15 tasks
loevgaard
force-pushed
the
dx/small-additive
branch
4 times, most recently
from
August 17, 2026 11:11
be4be05 to
9090728
Compare
loevgaard
force-pushed
the
dx/small-additive
branch
2 times, most recently
from
August 17, 2026 11:25
b272e95 to
1b90936
Compare
…, memoized callback payment, SDK version in User-Agent
- Payment::variables(): array — your custom variables with keys and value
types exactly as sent. Deliberately a method reading $raw rather than a
mapped property: Valinor's camelCaseKeys() recurses, so a typed property
would silently rename internal_ref → internalRef (and mixed values need
allowPermissiveTypes). Verified the live shape ({} when empty, types
preserved) before deciding.
- Payment::$deadlineAt (?DateTimeImmutable) and $acquirer (?string) typed
(live: ISO-8601 with Z / null until authorized).
- CreatePaymentRequest::$shopsystem (new Shopsystem payload: name/version) so
a plugin can identify itself on the payments it creates.
- Callback::payment() is memoized.
- User-Agent now carries the installed package version
(Setono-Quickpay-PHP/1.x.y (+url)) via Composer\InstalledVersions;
Client::version() is public; composer-runtime-api ^2.0 required.
- README: reading variables back, Shopsystem.
Refs #10 (finding 10).
The defensive catch was the only uncovered code in the PR (codecov patch + project checks). isInstalled() + a single expression keeps the same behaviour with no unreachable branch.
loevgaard
force-pushed
the
dx/small-additive
branch
from
August 17, 2026 11:29
1b90936 to
15f764a
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 10).
Five small, independent, additive improvements:
Payment::variables(): array— your custom variables with keys and value types exactly as sent. This is deliberately a method reading$raw, not a mapped property: while implementing I verified that Valinor'scamelCaseKeys()recurses into nested arrays, so a typed$variablesproperty would silently rename a consumer'sinternal_reftointernalRef(andmixedvalues would needallowPermissiveTypes()). The docblock explains this. Live shape verified:{}when empty, value types preserved (int/bool/nested).Payment::$deadlineAt(?\DateTimeImmutable) andPayment::$acquirer(?string) typed — live: ISO-8601 withZ(mapped by the existing formats) /nulluntil authorized. Appended as optional constructor params.CreatePaymentRequest::$shopsystemwith a newShopsystempayload (name/version,shopsystem[name|version]onPOST /payments) so a plugin/module can identify itself on the payments it creates (Quickpay shows it asmetadata.shopsystem_name/_version).Callback::payment()is memoized — a guard followed by a handler no longer decodes and maps the body twice.Setono-Quickpay-PHP/1.0.0 (+https://github.com/Setono/quickpay-php-sdk)viaComposer\InstalledVersions(Client::version()is public;composer-runtime-api ^2.0added torequire— it's a virtual platform package every Composer 2 install provides).README: reading variables back after the update example; a Shopsystem tip.
Tests: variables verbatim (snake_case + nested + types) / empty / absent / hand-built; deadline + acquirer mapping and nulls; shopsystem on the wire; memoization; UA format with a known version.