Repository navigation
feat: market-native settlement QR — VietQR, SEPA, UPI, PromptPay, Pix + link fallback (closes #11) - #17
Merged
Conversation
Foreign users cannot scan VietQR, so the payout profile is now market-aware. Six rails, chosen per member: VietQR (Vietnam), EPC/SEPA QR (Eurozone), UPI (India), PromptPay (Thailand), Pix (Brazil) - plus a freeform link/handle rail (PayPal.Me, Venmo, PayID, Zelle...) for markets with no open P2P standard: US, UK, CA, AU, JP, KR, SG, MY, ID... This is the Splitwise model - Splitz still never holds money, it just writes the recipient into the market's own standard so the payer's banking app opens prefilled. All four new QR payloads are generated offline as pure strings, same as VietQR: EMVCo TLV + CRC16-CCITT for PromptPay and Pix, a 12-line EPC payload for SEPA, an intent link for UPI. Builders are pinned to official test vectors (PromptPay byte-for-byte against dtinth/promptpay-qr fixtures, Pix against the static example in the Bacen BR Code manual incl. CRC 1D3D) - 13 new tests. Amounts are embedded only in VietQR (ledger is VND); the other standards omit the amount - all four allow it - and the sheet tells the payer to type the amount shown. When per-group base currency lands later, each rail can embed the amount in its own unit. Vietnamese users are untouched: existing bank fields keep working and take priority in resolution; the new columns (payment_rail, payment_data on group_members and profiles, migration 0035) are nullable. UI: shared PaymentMethodFields component (rail picker + per-rail fields, reusing BankFields for VietQR) wired into onboarding, payout settings and the member sheet; the payment sheet dispatches per rail with per-rail info rows, copy buttons and an open-link button for URL handles. docs/PAYMENTS.md records the market matrix, spec sources and how to add a market.
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.
Vấn đề
Người dùng ngoài Việt Nam không thể dùng VietQR (chuẩn NAPAS chỉ tồn tại trong hệ ngân hàng VN): không quét được và không có số tài khoản VN để điền. Issue #11.
Giải pháp: mỗi thị trường dùng chuẩn QUỐC GIA của thị trường đó
Nghiên cứu ~15 thị trường (ma trận đầy đủ trong docs/PAYMENTS.md) → 5 chuẩn hội đủ 3 điều kiện: sinh payload thuần client, không cần đăng ký merchant, spec mở do ngân hàng/quốc gia công bố. Thị trường còn lại (US, UK, CA, AU, JP, KR, SG, MY, ID…) rơi về link/handle tự do — đúng mô hình Splitwise đã chứng minh 10+ năm: không bao giờ động vào tiền, chỉ cho mỗi người dán cách người khác trả mình.
upi://pay?pa=VPA&pn=tênĐiểm thiết kế đáng chú ý
123456789 → 29B1). Không API ngoài, không dependency mới.payment_rail,payment_datatrêngroup_members+profiles, migration 0035) đều nullable.PaymentMethodFieldsdùng chung (chọn rail + field theo rail, tái dùngBankFieldscho VietQR) lắp vào 3 nơi: onboarding, cài đặt tài khoản nhận tiền, sheet thành viên. Sheet thanh toán dispatch theo rail: hàng thông tin + nút copy riêng từng chuẩn, nút mở link cho handle URL, hint amount cho rail ngoài VN.Kiểm chứng
Closes #11