Context: We're implementing concurrent payment handling for our fitness commitment…
- User
Context: We're implementing concurrent payment handling for our fitness commitment feature. Edge case: user opens payment flow on two devices simultaneously. Technical Setup:
Stripe Payment Sheet (Swift) Payment intents created before sheet opens Firestore listeners for real-time updates Cloud Tasks + FastAPI for webhook processing
Two approaches under consideration: Option A: Share payment intent across devices
Both sheets remain valid until one completes payment Winner updates via Firestore listener, loser sees success state Simpler implementation, relies on Stripe's idempotency
Option B: Cancel/replace on new session
When device 2 starts flow, cancel device 1's payment intent via Firestore listener Device 1 gets "reload required" message, device 2 proceeds More complex, but ensures only one active payment path
Questions for your input:
Any experience with Stripe payment intent concurrency patterns you'd recommend? Given our webhook → Cloud Tasks → FastAPI flow, concerns about payment intent cancellation timing? From a system reliability perspective, preference between Stripe-managed vs app-managed concurrency?
Goal: Prevent double payments while maintaining good UX for this edge case.
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.