#christian_api

1 messages ¡ Page 1 of 1 (latest)

vivid capeBOT
#

👋 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.

sly cloak
#

That said, it's hard to say for sure since your question is somewhat high-level. Can you provide more specific details?

carmine oar
#

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.

  1. Select a product (I have this coded to display on my website)
  2. on click be redirected to checkout (put in payment details and email)
  3. Authorize the payment details and not charge for 7 days
  4. After 7 day free trial is up, charge the payment method and start a monthly cadence of charging them for the specific product
sly cloak
carmine oar
#

That seems to just be for paymentintents not for checkout sessions

sly cloak
#

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.

carmine oar
#

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