#waleed-khalid_api

1 messages · Page 1 of 1 (latest)

minor nimbusBOT
#

👋 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/1300758713736626207

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

inland patio
#

Hello os4m37

tribal jetty
#

👋

inland patio
#

Hello, can you please guide me on api reference and flow

I need to implement subscription model in our system just like netflix.

I need to give free trial to customer for starting 10 days but capture their credit card details. for future autmatically capture payments from customer saved payment method. Need to have webhooks for all events so I can provision customer access. Also if automatic payment failed how we can proceed with it.

tribal jetty
#

This guide is a good starting point

#

And this one for configuring trial

minor nimbusBOT
graceful river
#

👋 taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

inland patio
#

sure i am still confused over the flow.

#

keeping trial thing apart. I need to implement subscription flow

graceful river
#

ok let's start by figuring out how you want to integrate with Stripe?

#

do you want to use the Checkout Sessions (hotsted or embedded) or are you looking for a custom form using PaymentElement?

inland patio
#

First I need to capture customer credit card details only so it will be saved payment method against my customer on stripe

#

then i did not need any any form stripe will automatically capture funds from client saved payment method

#

this is what i need to implement

graceful river
#

what you're describing is basically using SetupIntents to attach a PaymentMethod to your customer and then creating the Subscription later

#

that's not how we recommend building the Subscription flow

inland patio
#

I need same like netflix

#

how it captures customer credit card at first and then capture amount automatically when subscription ends adn satrt new one

graceful river
#

regardless of what the UI will finally look like

#

the integration path is still the same

#

also that doesn't answer which Stripe component you will be using Checkout Sessions or PaymentElement

#

let's start by taking that decision

inland patio
#

I will be using checkout session api for custom ui

graceful river
inland patio
#

this is the form to collect money from customer ?

#

and it will save the payment method for future use right ?

graceful river
#

yes

#

you just need to pass the subscription_data for trial and the recurring price in the line_items

#

of course instead of mode payment you would replace that with mode subscription

inland patio
#

i am checking this

graceful river
#

let me know if you need any more help

inland patio
#

I am checking

#

dont need to do anything for future auto payments strip will auto deduct from credit card ?

graceful river
#

yes, but you also need to keep track of payment failures due to requiring additional action from the user

#

to provision access to your service

inland patio
#

you just need to pass the subscription_data for the recurring price in the line_items

#

where to send subscription_data recurring price

graceful river
inland patio
#

recurring price is what stripe will capture from customer card when subscription endds? and stripe will again deduct amount ?

#

to continue that subscription ?

graceful river
#

no the recurring price is the price per cycle

#

so each cycle Stripe will attempt collecting that price

inland patio
#

I have 2 products for moonthly subscription and yearly subscription. can you send me an example checkout session api which mention recurring price, mode subscription etc

graceful river
#

but you can't have 2 different price intervals in the same subscription

#

like a yearly and a monthly prices

minor nimbusBOT
inland patio
#

line_items: {
price_data: {
currency: "",
product: "product_id",
recurring: {
interval: "month",
internal_count: 3
}
}
}

#

is this right

fleet knot
#

Hi! I'm taking over from my colleague. Please, give me a moment to catch up.

inland patio
#

sure