#Karan28-Subscription
1 messages · Page 1 of 1 (latest)
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?
I don't want to create subscription on the spot
I need to schedule
any update ?
Can you please help here
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?
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
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.
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.
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.
Yess
But in checkout session when user enters same card next time, stripe will create it as new payment method
Did you pass the same customer object when creating a checkout session?
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 ?
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.
It's not doing this ,its asking to add card everytime
{
success_url: 'https://example.com/success',
cancel_url: 'https://example.com/cancel',
mode: 'setup',
customer,
payment_method_types: ['card'],
}
This Is what I'm passing to create session
Can you send me the checkout session ID?
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
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.
So what should I do ?
Why do you need to create a second checkout session if you already collected the payment method in the first session?
Give me time I need to confirm some requirements.