Skip to content

feat: add checkout session params + expand discount data in webhook#36

Open
alim888aa wants to merge 1 commit intoget-convex:masterfrom
alim888aa:feat/checkout-session-params
Open

feat: add checkout session params + expand discount data in webhook#36
alim888aa wants to merge 1 commit intoget-convex:masterfrom
alim888aa:feat/checkout-session-params

Conversation

@alim888aa
Copy link

Closes issue #35

Adds optional parameters to createCheckoutSession:

  • allowPromotionCodes — enable promo code input on hosted checkout
  • paymentMethodTypes — explicit payment method control
  • paymentMethodOptions — method-specific config
  • discounts — server-applied coupons/promotion codes
  • locale — checkout page language
  • currency — currency override

Also expands discount/promotion code data in the checkout.session.completed webhook handler via stripe.checkout.sessions.retrieve() with expand: ["discounts.promotion_code"], so custom handlers can read the promotion code string directly without additional API calls. This follows the existing pattern where processEvent already retrieves subscriptions/invoices for subscription mode.

All new parameters are optional. Existing behavior is unchanged. Includes a runtime guard for the mutually exclusive allowPromotionCodes/discounts params.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@alim888aa alim888aa force-pushed the feat/checkout-session-params branch from 4ca331e to 9ca3adf Compare February 23, 2026 00:11
@alim888aa alim888aa force-pushed the feat/checkout-session-params branch from 9ca3adf to d9c0bf6 Compare February 23, 2026 03:09
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