Skip to content

fix(order-book): parse every payment method from the multi-value pm tag - #262

Merged
Catrya merged 1 commit into
mainfrom
fix/order-book-multi-payment-methods
Jul 31, 2026
Merged

fix(order-book): parse every payment method from the multi-value pm tag#262
Catrya merged 1 commit into
mainfrom
fix/order-book-multi-payment-methods

Conversation

@Catrya

@Catrya Catrya commented Jul 31, 2026

Copy link
Copy Markdown
Member

fix #261

  • Read all values of the pm tag instead of only the first one.
  • Re-join them with commas, mirroring the fa tag handling.
  • Keep the Dart side untouched: the payment filter already tokenizes on commas and the card renders the full string.
  • Add a regression test with a multi-value pm tag and assert the single-method case in the existing fixed-amount test.

Summary by CodeRabbit

  • Bug Fixes
    • Order events now correctly preserve multiple payment methods listed in a payment tag.
    • Existing single-payment-method behavior remains unchanged.

- Read all values of the pm tag instead of only the first one.
- Re-join them with commas, mirroring the fa tag handling.
- Keep the Dart side untouched: the payment filter already tokenizes
  on commas and the card renders the full string.
- Add a regression test with a multi-value pm tag and assert the
  single-method case in the existing fixed-amount test.
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c4909486-8100-4f20-8552-372712976b62

📥 Commits

Reviewing files that changed from the base of the PR and between 3fa7572 and 2fd5bfa.

📒 Files selected for processing (1)
  • rust/src/nostr/order_events.rs

Walkthrough

The order event parser now reads all pm tag values and joins them with commas. Tests preserve single-method behavior and verify ordered parsing of three payment methods.

Changes

Payment method parsing

Layer / File(s) Summary
Parse and validate payment methods
rust/src/nostr/order_events.rs
parse_order_event now preserves every pm tag value. Tests verify single-method parsing and ordered, comma-separated output for three methods.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: grunch

Poem

A rabbit found three methods in a tag,
Joined them with commas in a neat little flag.
One still stays one, three now come through,
Tests watch the parser do what it should do.
Hop, hop—payments are visible too!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: parsing every payment method from multi-value pm tags.
Linked Issues check ✅ Passed The parser now collects every pm tag value and tests multi-method and single-method behavior, satisfying issue #261.
Out of Scope Changes check ✅ Passed The changes are limited to pm tag parsing and related regression tests, which match issue #261.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/order-book-multi-payment-methods

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Catrya
Catrya merged commit 69f5692 into main Jul 31, 2026
4 checks passed
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.

Order book shows only the first payment method of multi-method orders

1 participant