#taviksha-akar_api

1 messages ¡ Page 1 of 1 (latest)

celest mesaBOT
#

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

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

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

torn rain
#

hello! If you are creating a subscription, you should only create a subscription using https://docs.stripe.com/api/subscriptions/create or https://docs.stripe.com/api/subscription_schedules/create

You should not be creating a PaymentIntent separately i.e. https://stripe.com/docs/api/payment_intents/create

ebon sundial
#

how will payments will be taken then? If we don't use payment intent then will the payment on subscription create will be taken automatically??

torn rain
#

I've already discussed this with you last week - did you try the suggestion I shared?

if you want to stop the automatic collection of the invoices for a period of time, then it sounds to me like https://docs.stripe.com/billing/subscriptions/pause-payment is what you're looking for. If you're using subscription schedules, then you would need to wait for the subscription to be created, then update the subscription to pause it. The subscription will be active. I'm not entirely certain if this is the exact behaviour you're looking for so you should test it to be sure

Learn how to pause payment collection on subscriptions.

ebon sundial
#

No, that was another case where I want to stop automatic collection. And now I am asking for the normal subscription flow.

#

where I have to take payments on subscription creation

torn rain
celest mesaBOT
ebon sundial
#

So how the user card will be attached to the subscription means where to get the default payment method id

#

?

cosmic badge
#

Hi @ebon sundial I'm taking over this thread

ebon sundial
#

yes I mean if a user is creating a subscriptio and enters a card at that time that card should be used to take payments

#

so we are creating payment intent and it returns us the client_secret and that client_secret is used further to get payment method id in front end side then we pass that payment method id on creatign subscription in "default_payment_method "

#

By doing this, there are two payments have been done

#

one is just after creating the payment intent and other in subscription create

#

we just need to have one payment

#

but it is taking two payments.

#

when payment intent payment has been created with incomplete status can we mark that same payment as paid on subscription creating without creating another payment??

#

hi there?

cosmic badge
#

Why do you need to create another paymentintent?

ebon sundial
#

it will return a client_secret which will be used in front side to get payment method id

cosmic badge
#

No you don't need to do that

#

You can just the client_secret from the payment_intent assocaited with the first invoice that subscription creates

ebon sundial
#

but there is a parameter default_payment_method what should we pass in it then?? how the card will be attached to the subscription?

cosmic badge
#

Are you able to use the example code in the doc that I shared earlier? you don't need to pass in an default_payment_method if you haven't collect a payment method yet.

ebon sundial
#

The doc is based on active subscription

#

We are creating scheduled subscription

cosmic badge
ebon sundial
#

this doc does not have payment process information

cosmic badge
#

Refer to the "Build a subscription" doc on details about payment method collection

ebon sundial
#

'payment_behavior' => 'default_incomplete',

this is given in the build a subscription doc, which is not supported on creating a scheduled subscription.

#

so how will this flow will work when creating a scheduled subscription.

cosmic badge
#

Hmm, I thought you are creating subscription schedule and let the schedule create subscription ? Why do you need to specify payment_behavior ?

ebon sundial
#

As you doc says, payment_behavior should be set as default_incomplete that's why I was trying to pass it.

cosmic badge
#

Just to confirm, are you still trying to build with subscriptions schedule?

ebon sundial
#

yes

cosmic badge
#

If you want to collect a payment method before creating a subscription schedule, you can use SetupIntent + PaymentElement, or a setup mode checkout session.

celest mesaBOT
ebon sundial
#

Ok so should I use SetupIntent which will not take payment?

void kindle
#

It depends on the use case. You'd use a SetupIntent to collect a card if you intend to then charge that card for the first time some hours/days later.