Rename the agreement option to agreement_id - #52
Merged
Conversation
`agreement` and `branding_id` are siblings — adjacent in the defaults, both optional integer payment-link ids, both cast to ?int, both landing on CreateLinkRequest as agreementId/brandingId — yet only one said what it was. The code needed a comment to explain that `agreement` means an id. It joins the alias map added for the credentials in #49, so this costs one line and no shop breaks. That matters more here than it did for the credentials: `agreement` is optional, so a stale key does not fail loudly the way a missing required credential would. It resolves to null, the payment link is created without an agreement id, and Quickpay quietly falls back to the account default — a shop pinned to a specific acquirer agreement would silently get a different one. Also fixes a doc error from #49: a global replace there rewrote the deprecated name too, so UPGRADE-2.0.md claimed the 1.x spellings were "apikey and private_key" — naming the new key as the old one. The upgrade guide now carries a table of all three renames instead.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 2.x #52 +/- ##
============================================
+ Coverage 97.40% 97.43% +0.02%
Complexity 126 126
============================================
Files 14 14
Lines 347 351 +4
============================================
+ Hits 338 342 +4
Misses 9 9 ☔ 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.
Renames
agreement→agreement_id, joining the alias map from #49.Why
agreementandbranding_idare siblings: adjacent in the defaults, both optional integerpayment-link ids, both
(int)-cast to?int, both landing onCreateLinkRequestasagreementId/brandingId. Only one of them said what it was — the other needed a code comment to explain thatagreementmeans an id.Why the alias matters more here than for the credentials
agreementis optional, so a stale key does not fail loudly the way a missing required credentialwould. It resolves to
null, the payment link is created without an agreement id, and Quickpay quietlyfalls back to the account default — a shop pinned to a specific acquirer agreement would silently get a
different one.
Reusing the existing alias map means that cannot happen: one line added, no migration, no shop breaks.
Deprecated, removed in 3.0, same as the credentials.
Also fixes a documentation error from #49
The global replace in that PR rewrote the deprecated name too, so
docs/UPGRADE-2.0.mdclaimed the1.x spellings were "
apikeyandprivate_key" — naming the new key as the old one. The upgradeguide now carries a table of all three renames instead, plus a note that
agreementis the one worthupdating soonest, for the silent-failure reason above.
Verified
New test pins both directions — old name, new name, unset stays unset, and the current name winning when
both are given. 225 tests, PHPStan level 8, ECS, mutation score up to 82% MSI / 83% covered.