#christian_api
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/1318717168057323551
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello! I think the guide you're looking for is here: https://docs.stripe.com/payments/place-a-hold-on-a-payment-method
That said, it's hard to say for sure since your question is somewhat high-level. Can you provide more specific details?
Yes! Thank you for your response. I am wondering how to best implement a checkout flow including placing a hold. I currently use checkout sessions and I like them because they provide a great interface for the user and is simple for upselling, having a logical flow. I am hoping that I can integrate payment intents with this but not sure. Essentially I am asking what the smoothest (most used) checkout flow with payment intents and with preauthorization for a subscription based service is
I want user to go through this flow, whether that is with both payment intents and checkout sessions or not, the key is that I need preauthorization.
- Select a product (I have this coded to display on my website)
- on click be redirected to checkout (put in payment details and email)
- Authorize the payment details and not charge for 7 days
- After 7 day free trial is up, charge the payment method and start a monthly cadence of charging them for the specific product
You can change the capture method on a Checkout Session to manual to place a hold on the funds instead of capturing them immediately: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-payment_intent_data-capture_method
That seems to just be for paymentintents not for checkout sessions
Checkout Sessions generate Payment Intents.
The API I linked to is the Checkout Sessions API. This specific parameter controls attributes of the Payment Intent Checkout creates.
Oh I see, then would I not use the trial end date in this implementation and just do it manualy after 7 days?
checkout_session_params = {
"payment_method_types": ["card"],
"line_items": [
{
"price": price_id,
"quantity": 1,
},
],
"mode": "subscription",
"client_reference_id": trakdesk_cid,
"success_url": url_for("free_success_checkout", _external=True)
+ "?session_id={CHECKOUT_SESSION_ID}"
+ f"&price={price}",
"cancel_url": "https://smartbettor.ai",
"subscription_data": {"trial_end": trial_end_date},
}
Here is my current checkout_session_params, If I do manual, how do I charge it later, and how do I indicate that it is a free trial. Currently when I use the trial_end in the subscription data it shows up in the checkout session