fix: Validate Razorpay order_id before initiating checkout - #1167
fix: Validate Razorpay order_id before initiating checkout#1167kadhir-17 wants to merge 1 commit into
Conversation
|
Claude finished @kadhir-17's task in 1m 12s —— View job Claude finished reviewing this PRTodo List:
SummaryThis is a small, well-targeted fix: Observations
No security, threading, or architecture concerns — the change is synchronous, UI-thread-only (consistent with the rest of this class), and doesn't introduce any leaks or nullability issues ( Overall: solid, minimal fix for a real bug. Recommend merging; test coverage is the only thing I'd suggest adding, either in this PR or a fast follow-up. |
When students initiated payments without a valid Razorpay Order ID, money was deducted from their bank account and immediately auto-refunded by Razorpay due to a missing order intent.
To prevent failed checkouts and unexpected auto-refunds, added a pre-checkout validation check ensuring the Order ID is present, non-empty, and strictly follows Razorpay's "order_" prefix convention. If invalid or missing, the SDK now halts checkout immediately, dismisses the loading spinner, and directs the user to the payment failure screen.
Todo:
https://app.basecamp.com/4160028/buckets/48707509/card_tables/cards/10267968559