Skip to content

feat(settlement): add get_effective_rule(merchant) read - #606

Open
Userally16 wants to merge 1 commit into
Betta-Pay:mainfrom
Userally16:issue-579-get-effective-rule
Open

feat(settlement): add get_effective_rule(merchant) read#606
Userally16 wants to merge 1 commit into
Betta-Pay:mainfrom
Userally16:issue-579-get-effective-rule

Conversation

@Userally16

Copy link
Copy Markdown

Closes #579

Adds a public get_effective_rule(merchant) entry point to the Settlement contract, mirroring governance's get_fee_config. The function resolves the full fallback chain used by payment processing: merchant override -> global default -> governance FeeConfig -> bootstrap. Callers no longer need to reconstruct resolution logic manually.

Six tests cover: bootstrap fallback, global default application, merchant-rule override, cleared-rule fallback to global default, unregistered-merchant rejection, and BPS consistency with calculate_fee_split.

Description

Related Issues

Closes #

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • ⚡ Performance improvement
  • ♻️ Refactor / Code cleanliness
  • 📝 Documentation update
  • 🔧 Tooling / CI configuration

Checklist

  • My code follows the code style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation (if applicable).
  • My changes generate no new compiler warnings or lints.
  • I have added tests that prove my fix is effective or that my feature works (if applicable).
  • All new and existing tests pass locally.

Additional Notes / Screenshots

Closes Betta-Pay#579

Adds a public get_effective_rule(merchant) entry point to the
Settlement contract, mirroring governance's get_fee_config. The
function resolves the full fallback chain used by payment processing:
merchant override -> global default -> governance FeeConfig ->
bootstrap. Callers no longer need to reconstruct resolution logic
manually.

Six tests cover: bootstrap fallback, global default application,
merchant-rule override, cleared-rule fallback to global default,
unregistered-merchant rejection, and BPS consistency with
calculate_fee_split.
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.

Settlement has no get_fee_config-analog exposing the effective fee for a merchant

1 participant