fix(paycraft): Razorpay INR-currency resilience + correct quarterly period - #111
Conversation
…eriod Two fixes for the failing 'Sync products to providers' on Razorpay: 1. Period: Razorpay's Plan period enum is daily|weekly|monthly|yearly — there is no 'quarterly'. quarter now maps to monthly x3 (semiannual already monthly x6). Fixes 'Invalid argument for period passed' on Pro Quarterly. 2. Currency: Razorpay rejects currencies the account isn't enabled for (USD on an INR-only account → 'Currency provided is not supported'). syncProductToRazorpay now skips unsupported currencies per-item and continues, so INR plans still sync while USD is skipped; any non-currency error still propagates. When every currency is skipped, razorpaySyncProduct returns a clear 'add an INR price (or enable International)' message instead of a silent fail. Stripe (USD, global) is unchanged. tsc --noEmit clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesRazorpay Unsupported Currency Handling
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Resolves the 4/4 Razorpay sync failures surfaced after the error-surfacing fix:
Invalid argument for period passed(Pro Quarterly): Razorpay's Planperiodenum is only daily|weekly|monthly|yearly — noquarterly.quarternow maps to monthly × 3 (semiannual already monthly × 6).Currency provided is not supported(USD): Razorpay is INR-first.syncProductToRazorpaynow skips unsupported currencies per-item and continues (so INR plans sync while USD is skipped), and returns a clear 'add an INR price / enable International' message when every currency is skipped. Non-currency errors still propagate.Model: Stripe = USD (global), Razorpay = INR (India). Stripe path unchanged.
tsc --noEmitclean.🤖 Generated with Claude Code
Summary by CodeRabbit