#magius_best-practices
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1306600057046306866
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi! yeah this is a bit complicated to handle. It's easier if you use Checkout since it natively handles this : https://docs.stripe.com/payments/checkout/no-cost-orders
if in your case basically if the amount comes down to 0, you'll have to create a SetupIntent and confirm that with confirmSetup and set up the logic to choose which to call when.
You mention a Subscription too; if you create a Subscription with no immediate payment like a trial or 100% coupons, there's a pending_setup_intent that exists on the returned Subscription object and that's what you'd confirm on the frontend instead.
Cheers for the info ๐
I don't think we're using the 'Subscription' concept on the Stripe side (not 100% sure) - as far as I know the only difference we report to Stripe is the setup_future_usage param
It sounds like in this case for a sub (i.e. an order where we're saving details) we need to cancel the PI, create an SI, and re-render the payment element (and then wind all of that back should they cancel using the credit).
Sadly we're not in a position to use the Stripe-provided Checkout flow because there's all other things we need to accomplish on the same page
Just before I report back: is there any way at all to get a PaymentIntent to allow an amount smaller than the minimum? Is it a feature that could be supported to cover cases like these where applying credit takes you under the minimum amount?
is there any way at all to get a PaymentIntent to allow an amount smaller than the minimum?
yes, but not zero.
You can charge smaller than the minimum if you write to support and ask us to enable it for your account. It's not enabled by default because you'll lose money because the fixed component of the Stripe processing fee is more than you charge.
It sounds like in this case for a sub (i.e. an order where we're saving details) we need to cancel the PI, create an SI, and re-render the payment element (and then wind all of that back should they cancel using the credit).
yes. If I were doing this I'd design the flows so all the "create your order, enter coupons, select products" happens on one page and only after that's complete and you know what the order total is, do you redirect/reveal the PaymentElement and can initialise that appropriately
I see - thank you for all of this; I'll feed it back
I might have followup questions later - but I'm happy to raise those in a new question if that's easier on your side