#zelda.zonk
1 messages ยท Page 1 of 1 (latest)
hello! Stripe coupons don't work with the Payment Element. It only works with Stripe Checkout or Invoices
ok, so if im using payment intents with payment element for single charges, i would need to handle coupon code / logic within my app? So discount amount (apply coudon code) before creating payment intent with amount?
yep, that's correct
ok, makes sense, what about stripe coupons and susbcriptions using payment element with setup intents?
you can apply the coupon when creating a Subscription, so the final amount will include the coupon applied
ok so i can have stripe coupons for susbcriptions but i'll also need app level coupons for payment intents. could I have stripe coupons for both, but when using payment intents i query stripe api to validate coupon and then manually discount the amount when creating payment intent? I would then need to (using stripe webhook) on successful checkout, query they stripe api again though to mark coupon off as used right?
i want all coupons in one spot either locally or in stripe
Yeah I understand you want them in one spot, but unfortunately we don't support coupon on PaymentIntent as an one-off transaction
For it yes you would need to calculate the discounted amount and pass in
so i cant query stripe api to validate coupon and then manually discount the amount when creating payment intent?
and then manually mark it off as used i guess because theres NO charge id associated with it?
is there any plans to introduce coupons into payment element? This is a big downside to using it then
How would you "manually mark" a Coupon off? I don't think there is such an option
It's a common ask btw and I will also forward your feedback. Thank you!
ok so, thats means i will have to manage coupons locally (payment intent and setup intent checkouts), which will mean having to change subscription amount on the fly, can I do this? As i know you have to setup a price on a subscription product in stripe. When creating setup intent can i change amount or price of subscription ?
For Subscription specifically you can use a Stripe coupon ie. https://stripe.com/docs/billing/subscriptions/coupons?dashboard-or-api=api#discount-subscriptions
thanks but i dont want to use stripe coupons if i cant use them with payment intents, as i said i want all coupons either in app or in stripe, in one spot.
so i need to know can i change susbcription price when creating setup intent?
Ah I see, like build a complete Coupon system yourself
When creating SetupIntent yes you can specify the amount. If you already created a SetupIntent with full amount, you may want to recreate another one with the discounted amount
couldnt i just update the setup intent (if already created) with discounted amount? I update payment intent amount during checkout, if user adds more to cart then comes back to checkout.
I don't think you can update SetupIntent amount, looking at the parameters here https://stripe.com/docs/api/setup_intents/update
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Oh wait sorry
SetupIntent doesn't have an amount
SetupIntent meant to not charge, so it's $0 anyway
so how would i discount the subscription price / amount on the fly?
what do you mean by discount the subscription price/amount on the fly? When you create a Subscription you can pass in a coupon : https://stripe.com/docs/api/subscriptions/create#create_subscription-coupon
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
like i said earlier i dont want to use stripe coupons if i cant use them with payment intents.
i need to manually discount the subscription price and when creating subscription use that price not the Price ID, is this possible?
i'm sorry but i'm really confused here - firstly, are you creating a Subscription using this API : https://stripe.com/docs/api/subscriptions/create?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
yes
what i mentioned is to pass in the coupon when creating the Subscription. The corresponding PaymentIntent genereated by the Invoice will already be the discounted amount
have you tried that?
where do i create this coupon?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
but as i said earlier i dont want to use stripe coupons
why not?
because i cant use them with payment element when user checkouts with payment intent.
i want all my coupons in one place
so if i understand correctly, you want a way to manually specify how much or edit the amount a customer should pay for each Invoice on a Subscription?
if they use a coupon yes, and that coupon wouldnt be a stripe coupon it would be an app level coupon
and how would your coupons work? is it only going to apply a discount for the lifetime of the subscription?
or there's many possible variations?
there could be many variations, but for now lets say the lifetime of sub, say its priced at $99 in stripe products, but i want user to have it for $50 for lifetime of subscription.
then you can just create a Price for $50 / interval
so for every coupon i make i would need to make a subscription product to match it?
thats not a good solution, cant i just pass in new price when creating subscription that overrides the price id?
wait can you explain, or create a new Price
you can generate a new Price inline if that's what you prefer - https://stripe.com/docs/api/subscriptions/update#update_subscription-items-price_data
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
one of those APIs depending on what you're trying to do specifically
and that price would only affect that customers subscription?
that parameter essentially creates a new Price inline, yes, it will only affect that customers subscription
i suggest you test it out to make sure it works as per what you expect
perfect, thats what i was after
man, not having coupons in payment element is maddening
i think the easiest approach would be to chnage my checkout flow from using payment element to Stripe Checkout, that way i can use stripe coupons and i wouldnt have to build coupon logic. Then hopefully in future stripe implements coupons into payment element and i can switch back.
that makes sense. Checkout is a lot easier to implement and you can use it for both Subscriptions and one-time payments
yeah, i think thats the best way to go. I apprechiate all your help, thanks for answering all my questions. ๐
there's the quickstart guide here to quickly get up and running to see how it works : https://stripe.com/docs/checkout/quickstart
thanks
one last question, with Checkout, do you i have to create all my products in stripe? Products that are not subscription so one-time payments? Currently using payment intent i dont need to do this
it's similar to what i mentioned earlier, you can create Prices inline too : https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ok great thanks again
oh sorry one more thing, at the moment i prepopulate address element, can i send over address info to Stripe Checkout to prepopulate?
you won't be able to prepopulate that information in Checkout. I'd just leave it to Stripe Checkout to collect that information really
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-phone_number_collection
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
thanks again, i think im all set now.
oh sorry one more, question last one i promise. My client wants to setup Installment plans, and i saw this documentation https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases#installment-plans can I do this implementaiton in the future with Stripe Checkout?
yes, it's possible, just a bit more complicated. The way i would go about it is after the first payment for the subscription is completed and you receive a webhook event for that, create a Subscription Schedule for that Subscription
my clients wants to basically create there own pay later type thing, so lets say user adds 3 products to cart, total is $90 for this example lets say there are no subscription products in cart. and client wants user to be able to split the $90 into lets say 10 monthly payments of $10, is this achievable with Subscription Schedules ?
you're going to need to create a Subscription for that use case essentially. Following your example : you would need to create a Subscription for $10/month first and the customer will pay for that
then you can create a Subscription Schedule to schedule when the Subscription ends
ok great, since total cart amount could be $90 or $200 for example, the monthly payment could vary, so $90 over 10 monthly payments would be $9/month but $200 over 10 monthly payments would be $20/month so could I can generate a new Price inline for subscription like you mentioned earlier?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
great thanks
is there a way to save this thread for future reference?
so i can come back and read
it'll always be here
this link i think : https://discord.com/channels/841573134531821608/1136516548845117590
in case you haven't seen this yet, you can use test clocks to mimic the passing of time : https://stripe.com/docs/billing/testing/test-clocks
thanks