#bhanu-help
1 messages · Page 1 of 1 (latest)
Hi there!
Snufkin had to step away
Can you summarize your issue/question here? I'd be happy to help
When I'm rendering the payment element I am passing 'intent' => $this->user->createSetupIntent() and then $intent->client_secret. I am not creating subscription and then get client secret
So what I need to do next?
Do I need to create subscription after call stripe.confirmPayment
Are you just collecting payment method details from a customer or are you trying to create a Subscription for them while they are in your flow?
I am trying to create subscription
and payment method also
because when subscription ends so it will be automatically renew as well
Gotcha and does your Subscription involve a trial?
customers can upgrade their subscription but can't downgrade
You want to just create the Subscription itself. When you do so you want to set save_default_payment_method: https://stripe.com/docs/api/subscriptions/create#create_subscription-payment_settings-save_default_payment_method
This will ensure that the PaymentMethod used to make the initial payment is saved to the Customer and will be used for renewal payments
After you create the Subscription the Subscription will return an Invoice which will have a PaymentIntent. You use that PaymentIntent's client secret to render Payment Element
And what about what I have already the client_secret that I get from the paymentIntent according to laravel?
$this->user->createSetupIntent()
This one
I am getting client_secret from this function $this->user->createSetupIntent()
So i don't need to create subscription first
Or i am doing wrong way
?
Sorry helping several folks at once
Yeah you want to create the Subscription itself
Not a SetupIntent
A SetupIntent would only be used if you weren't actually starting a Subscription until sometime in the future when the customer isn't in your flow
ok got it
And what about when I need to update customer card details if customer card has expired or something
There are a couple ways to handle that
Like?
Sorry 🙂
Jumping around between threads
So the first way is you can get Stripe to send emails for you
You can do that via https://dashboard.stripe.com/settings/billing/automatic
That page in your Dashboard allows you to set up these emails
Another way would be to integrate the Customer Portal.
I need to integrate the customer portal on our website
where customer can update their card details
Which API I need to call for this?
and js method
https://stripe.com/docs/billing/subscriptions/integrating-customer-portal walks you through the integration
I'm not sure what you mean by that?