Skip to content

fix: use coupon ID directly instead of Stripe promotion codes - #82

Merged
thomasluizon merged 1 commit into
mainfrom
fix/referral-coupon-stripe-sdk
Mar 28, 2026
Merged

fix: use coupon ID directly instead of Stripe promotion codes#82
thomasluizon merged 1 commit into
mainfrom
fix/referral-coupon-stripe-sdk

Conversation

@thomasluizon

Copy link
Copy Markdown
Owner

Summary

  • Stripe SDK v50 PromotionCodeCreateOptions requires promotion[type] which caused Missing required param error
  • Simplified: store coupon ID directly instead of creating promotion codes
  • Checkout uses Discounts.Coupon instead of Discounts.PromotionCode
  • Removed unnecessary Stripe customer creation for coupon recipients

Test Plan

  • Trigger referral completion -- coupon should be created in Stripe
  • ReferralCouponId should be set on both users
  • Checkout should show 10% discount

🤖 Generated with Claude Code

Stripe SDK v50 PromotionCodeCreateOptions requires promotion[type]
which is undocumented. Simplified to store the coupon ID directly
and pass it via Discounts.Coupon at checkout. Removes unnecessary
Stripe customer creation for coupon recipients.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@thomasluizon
thomasluizon merged commit 0672033 into main Mar 28, 2026
2 checks passed
@thomasluizon
thomasluizon deleted the fix/referral-coupon-stripe-sdk branch March 28, 2026 17:43
thomasluizon added a commit that referenced this pull request Jun 5, 2026
Add three read-only IAiTool implementations that wrap existing MediatR
queries so in-app chat users can ask for their daily summary, a
retrospective, or a single habit's metrics:

- get_daily_summary -> GetDailySummaryQuery (defaults dates to user-today)
- get_retrospective -> GetRetrospectiveQuery (period -> date-range)
- get_habit_metrics -> GetHabitMetricsQuery (GUID-validated)

PayGate / failure results surface as ToolResult(false, Error: ...) rather
than being swallowed. Registered in DI and mapped onto the existing
HabitMetricsRead / DailySummaryRead / RetrospectiveRead catalog
capabilities via chatTools.

Refs thomasluizon/orbit-ui-mobile#82

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
thomasluizon added a commit that referenced this pull request Jun 5, 2026
#180)

Add three read-only IAiTool implementations that wrap existing MediatR
queries so in-app chat users can ask for their daily summary, a
retrospective, or a single habit's metrics:

- get_daily_summary -> GetDailySummaryQuery (defaults dates to user-today)
- get_retrospective -> GetRetrospectiveQuery (period -> date-range)
- get_habit_metrics -> GetHabitMetricsQuery (GUID-validated)

PayGate / failure results surface as ToolResult(false, Error: ...) rather
than being swallowed. Registered in DI and mapped onto the existing
HabitMetricsRead / DailySummaryRead / RetrospectiveRead catalog
capabilities via chatTools.

Refs thomasluizon/orbit-ui-mobile#82

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant