#builderman_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. Thank you for your patience!
âąď¸ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime! If this thread is closed and you have another question you'll need to start a new thread.
đ 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/1214344087562625136
đ Have more to share? You can add more detail below, including code, screenshots, videos, etc.
Hi there! How are you currently integrating with Stripe? Are you using Checkout or a custom flow using the PaymentElement?
I am using stripe's hosted checkout but may move to a checkout element
And by Checkout Element, you mean "Embedded Checkout"? https://docs.stripe.com/payments/checkout/how-checkout-works?payment-ui=embedded-form
Yes
This is how a competitor does it
And they preauth for the free trial
Release funds if they cancel, capture if they proceed
I am not sure how I can do this
as in the best practices
I understand how I can preauth but I am not sure how I could handle this internally, or if I could use stripe's native subscriptions to handle it for me
Release funds if they cancel, capture if they proceed
You can only do this if you use the PaymentElement and integrate with the PaymentIntents API directly so I think there's a misundersatnding of what's actuall happening in the background: https://docs.stripe.com/payments/place-a-hold-on-a-payment-method
Oh yeah I see
But with regards to using stripe's trials would I use that
Or is this something that needs to be handled internally
Because to my knowledge there is no way to attach a preauthorization to a trial
If I start a free trial and preauth at the same time it will result in two charges
If you're using Checkout (or Embedded Checkout), you wouldn't create the Subscription yourself. Instead, you'd create a Session in subscription mode. By default, we'll always prompt a customer to provide payment method details for subscription mode, even if there's a trial. This means the PaymentMethod that the customer sets up when they complete the Checkout Session should be set up correctly for future off-session Subscription charges.
Yes I am aware of that
This doesn't really solve what you're after though. Placing a hold/doing a preauth can't be done with Subscriptions
You could charge them up front for the full billing cycle but give them a credit or use a 100% off coupon for the next billing cycle
Or you could avoid collecting payment for the trial and then cancel the Subscription if the trial ends and they still haven't provided a payment method: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-subscription_data-trial_settings-end_behavior-missing_payment_method
How would a competitor do that like I mentioned above
They use the stripe payment element
I believe they use that payment element to capture the funds for the trial, and then handle the trial logic internally?
Right, and they're likely not using Subscriptions but handling billing logic on their end and creating PaymentIntents directly instead
So they're likely using the PaymentElement to confirm a PaymentIntent with capture_method: manual, keeping track of the trial end time internally, and manually capturing the funds at the end of the trial. Then, for renewal payments, creating off-session PaymentIntents using the previously-saved PaymentMethod
Ok great, I will make sure to do that then thank you for your help
With regards to link payments and other things, does the stripe payment element contain everything the stripe hosted checkout has?
I'm not sure if my customers would deem a payment element more trustworthy compared to being redirected to an official stripe checkout
In terms of PaymentMethod support, yes: https://docs.stripe.com/payments/payment-methods/integration-options#product-support
You too!