Skip to content

Rename the agreement option to agreement_id - #52

Merged
loevgaard merged 1 commit into
2.xfrom
feature/rename-agreement-option
Aug 10, 2026
Merged

Rename the agreement option to agreement_id#52
loevgaard merged 1 commit into
2.xfrom
feature/rename-agreement-option

Conversation

@loevgaard

Copy link
Copy Markdown
Member

Renames agreementagreement_id, joining the alias map from #49.

Why

agreement and branding_id are siblings: adjacent in the defaults, both optional integer
payment-link ids, both (int)-cast to ?int, both landing on CreateLinkRequest as agreementId /
brandingId. Only one of them said what it was — the other needed a code comment to explain that
agreement means an id.

Why the alias matters more here than 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.

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.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, plus a note that agreement is the one worth
updating 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.

`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

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.43%. Comparing base (55f465e) to head (2643ac1).

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.
📢 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.

@loevgaard
loevgaard merged commit 921a618 into 2.x Aug 10, 2026
21 checks passed
@loevgaard
loevgaard deleted the feature/rename-agreement-option branch August 10, 2026 11:46
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