Guard payment view if no payment intent returned#56
Guard payment view if no payment intent returned#56carl-lee-lu wants to merge 1 commit intospree:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
WalkthroughA conditional guard is added to the Stripe payment checkout template, ensuring the checkout block renders only when both the Stripe gateway and payment intent objects are present. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
When applying coupon codes that give a full discount, this stops a payment intent from being created which in turn breaks the route helper as it expects an ID.
Fix
Simply guard against not having a payment intent
Steps to reproduce
Note
Low Risk
Small view-only guard that avoids nil route generation; behavior change is limited to hiding Stripe UI when a payment intent is unavailable.
Overview
Prevents checkout crashes when Stripe is enabled but no
PaymentIntentis created (e.g., 100% discount orders) by guarding the Stripe payment partial behindcurrent_stripe_gateway.present? && current_stripe_payment_intent.present?.This avoids generating Stripe route helpers that require a
payment_intent.idwhen the intent isnil, eliminating the 500 during the payment step.Written by Cursor Bugbot for commit 978a39f. This will update automatically on new commits. Configure here.
Summary by CodeRabbit