#Karan28-Subscription

1 messages · Page 1 of 1 (latest)

hollow kite
#

hello! Is there a reason why you're creating a Checkout Session with mode=setup, instead of mode=subscription to directly collect the payment method and create a Subscription?

lethal dirge
#

I don't want to create subscription on the spot

#

I need to schedule

#

any update ?

#

Can you please help here

gaunt bane
#

Hi @lethal dirge I'm taking over

#

So basically you want the same customer to use a previously used payment method to pay a new subscription?

lethal dirge
#

Yes but as I'm using checkout is there any way with checkout ?
Or any stripe hosted way with checkout ?
Am I going in a right way to schedule and create subscription ?

#

Please guide

gaunt bane
#

Subscription schedule and Checkout session are two different things, can you tell me what you intent to achieve so that I can advise the best possible solution accordingly.

lethal dirge
#

I want to create a scheduled subscription where we just want to ask for payment on create subscription ,we don't have any update subscription flow as of now. Just create and cancel subscription. So I used checkout to collect payment method and on success webhook created subscription with specified start date.

gaunt bane
#

Got it. So you can use the mode=setup checkout session to collect the payment method without charging the customer, and then create a subscription schedule to use the collected payment method as the default payment method for the subscription.

lethal dirge
#

Yess

#

But in checkout session when user enters same card next time, stripe will create it as new payment method

gaunt bane
#

Did you pass the same customer object when creating a checkout session?

lethal dirge
#

You mean when I create next session

#

Yes in next as well I will pass same cutsomer, but user need to add card right in mode SETUP ?

gaunt bane
#

If the same customer has already used a card in the previous checkout session, in the next checkout session, the checkout page will pre-fill the previously used card details.

lethal dirge
#

It's not doing this ,its asking to add card everytime

#

This Is what I'm passing to create session

gaunt bane
#

Can you send me the checkout session ID?

lethal dirge
#

Let me create new session

#

1st session ID:cs_test_c1cKDMpr88AujGOXFUKxg5iy9CU4GPxQiI5noKXpXhk4ihZXEjSfSCr3gh

2nd session ID:
cs_test_c1Ll77ShcYy6z8MZMHYWCIR70yWWmshgI0lTRIfPeIMmJKGJ3uUUDnFe6Q

In 2nd I'm not getting pre filled

#

payment method

gaunt bane
#

Ah, you are using setup=mode in both checkout sessions. The purpose of setup mode checkout sessions is to collect a payment method, and that's why it won't pre-fill payment method field.

lethal dirge
#

So what should I do ?

gaunt bane
#

Why do you need to create a second checkout session if you already collected the payment method in the first session?

lethal dirge
#

Give me time I need to confirm some requirements.