Skip to content

feat: add get_effective_rule for per-merchant fallback resolution - #670

Open
samjay8 wants to merge 1 commit into
Betta-Pay:mainfrom
samjay8:fix/issue-525
Open

feat: add get_effective_rule for per-merchant fallback resolution#670
samjay8 wants to merge 1 commit into
Betta-Pay:mainfrom
samjay8:fix/issue-525

Conversation

@samjay8

@samjay8 samjay8 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Closes #525

Summary

  • get_settlement_rule returns None when no merchant-specific rule is stored, even though the merchant has an effective rule from the default/fallback chain that the API hides. This divergence means consumers see "no rule" for a merchant that actually has one.
  • Added get_effective_rule(merchant) that always returns a rule by following the full resolution chain: merchant-specific → global default → governance fee config → bootstrap fallback.
  • Added an integration test covering the per-merchant fallback case.

Scope

Does not modify existing get_settlement_rule or get_default_rule — purely additive. Does not touch write paths or payment logic.

Testing

Files changed

  • settlement_contract/src/settlement.rs — added get_effective_rule method with documentation
  • settlement_contract/src/tests/integration_tests.rs — added integration test for per-merchant fallback

@drips-wave

drips-wave Bot commented Aug 26, 2026

Copy link
Copy Markdown

@samjay8 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

…(issue Betta-Pay#525)

Added get_effective_rule(merchant) that always returns a rule by following
the full resolution chain: merchant-specific → global default → governance
fee config → bootstrap fallback. Added an integration test covering the
per-merchant fallback case.

Also fixed unused variable warning in _transfer_admin.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
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.

get_settlement_rule likewise returns None when a default/fallback applies

1 participant