fix(paycraft): correct Razorpay plan billing cadence for quarter/semiannual - #107
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
paycraft-docs | 5281103 | Jun 23 2026, 02:54 PM |
…annual syncProductToRazorpay mapped every non-month interval to a yearly plan with multiplier 1, so Pro Quarterly and Pro Semiannual were created as yearly-billing Razorpay plans — a revenue mismatch. Added razorpayPlanCadence() mapping each interval to the correct Razorpay period + multiplier (month→monthly×1, quarter→quarterly×1, semiannual→monthly×6, year→yearly×1); unknown intervals now throw instead of silently minting a wrong-cadence plan. tsc --noEmit clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
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 (1)
📝 WalkthroughWalkthroughAdds a ChangesRazorpay Billing Interval Mapping
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 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 |
Problem
syncProductToRazorpaymapped every non-monthinterval to ayearlyRazorpay plan with a hardcoded multiplier of 1. Pro Quarterly and Pro Semiannual products would be created as yearly-billing plans — a revenue mismatch (customer pays the quarterly/semiannual price but is billed once a year). Razorpay plans are immutable after creation, so this had to be fixed before any provider sync.Fix
Added
razorpayPlanCadence()mapping every PayCraft billing interval to the correct Razorpayperiod+ multiplier:Unknown intervals now throw (surfaced as a failed sync) instead of silently minting a wrong-cadence plan. Stripe path was already correct.
tsc --noEmitclean.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes