@@ -183,17 +183,6 @@ impl StripeClient {
183183 pub async fn create_checkout_session (
184184 & self ,
185185 tier : SubscriptionTier ,
186- ) -> Result < CheckoutSession , super :: StripeError > {
187- self . create_checkout_session_with_options ( tier, None , None , None ) . await
188- }
189-
190- /// Create a checkout session with full options including referral support
191- pub async fn create_checkout_session_with_options (
192- & self ,
193- tier : SubscriptionTier ,
194- referral_code : Option < & str > ,
195- promotion_code : Option < & str > ,
196- customer_email : Option < & str > ,
197186 ) -> Result < CheckoutSession , super :: StripeError > {
198187 let price_id = tier
199188 . stripe_price_id_monthly ( )
@@ -205,30 +194,12 @@ impl StripeClient {
205194 ( "cancel_url" , self . config. cancel_url. clone( ) ) ,
206195 ( "line_items[0][price]" , price_id. to_string( ) ) ,
207196 ( "line_items[0][quantity]" , "1" . to_string( ) ) ,
208- // Allow users to enter promotion codes at checkout
209- ( "allow_promotion_codes" , "true" . to_string( ) ) ,
210197 ] ;
211198
212199 // Add metadata
213200 params. push ( ( "metadata[tier]" , tier. display_name ( ) . to_string ( ) ) ) ;
214201 params. push ( ( "metadata[source]" , "cx-terminal" . to_string ( ) ) ) ;
215202
216- // Add referral code to metadata for tracking
217- if let Some ( ref_code) = referral_code {
218- params. push ( ( "metadata[referral_code]" , ref_code. to_string ( ) ) ) ;
219- params. push ( ( "client_reference_id" , ref_code. to_string ( ) ) ) ;
220- }
221-
222- // Pre-apply a Stripe promotion code if provided
223- if let Some ( promo_code) = promotion_code {
224- params. push ( ( "discounts[0][promotion_code]" , promo_code. to_string ( ) ) ) ;
225- }
226-
227- // Pre-fill customer email if known
228- if let Some ( email) = customer_email {
229- params. push ( ( "customer_email" , email. to_string ( ) ) ) ;
230- }
231-
232203 let response = self
233204 . client
234205 . post ( format ! ( "{}/checkout/sessions" , self . base_url) )
0 commit comments