#Dhruv
1 messages · Page 1 of 1 (latest)
Hi there,
First of all, I invite you to follow our recommended way to implement Subscription integration using Stripe Elements:
https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
- We found no way to show tax info (via API or any element) as shown in the checkout product
Stripe Element is just for collecting PaymentMethods, you need to display the checkout details in your own UI. For tax infos, you can refer to this guide for using Subscription with tax:
https://stripe.com/docs/billing/taxes
you can use either Stripe Tax (recommended) or create your own tax rate
https://stripe.com/docs/billing/taxes/collect-taxes
The main issue with this is that if we update the quantity, it creates new incomplete subscriptions every time. We cannot edit the subscription if it is incomplete state, so we have to del and then create new for a quantity change before payment.
What API call you are doing that creates a new Subscription when you update the quantity ?
Thanks for replying.
- I am using the same way to implement custom subscriptions.
- We use Stripe Tax but is there a way to show the tax amount in our UI via any API or Stripe Element?
- According to this flow: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements We create a customer -> create a subscription with quantity 1 -> return client_secret to FE -> use client_secret to load PaymentElement ->
now let's say user wishes to change the quantity to 5 -> we have no way to update the same subscription in incomplete status which is created , so we have to delete this sub and create new sub with quantity 5 and return the new client_secret and reload the PaymentElement
- We use Stripe Tax but is there a way to show the tax amount in our UI via any API or Stripe Element?
Using Stripe Element no, but you can preview the price including the tax by fetching the upcomming invoice of the customer/subscription:
https://stripe.com/docs/billing/taxes/collect-taxes?tax-calculation=stripe-tax#preview-price
Did you try to use the update API on the subscription? https://stripe.com/docs/api/subscriptions/update if not, can you share the ID (req_xxx) of the failing API request?
https://support.stripe.com/questions/finding-the-id-for-an-api-request
- Yes, we tried the
stripe.subscriptions.updatewith newquantityorpriceIdbut the response says that you cannot update the subscription in incomplete status.
Yes in fact, I just did a test. Then you could complete the subscription creation (adding a payment method) then update it or delete it and create a new one if the customer want to update the subscription before entering their card
Or you can try using Subscription Schedule https://stripe.com/docs/billing/subscriptions/subscription-schedules then you can update the subscription_Schedule
I think i'll go with deleting and then creating a new one. But this is not the solution I had in mind. When we use Stripe checkout, there is no customer or subscription created until the payment is done. Is there no way to replicate that flow? Right now we see multiple cancelled/incomplete payments with unpaid customers when they move back from entering card details.
That's a Stripe Checkout behavior. With Stripe Elements you need the client_secret in order to render Stripe Element. You can inverse the logic by saving the PayemntMethod of the customer https://stripe.com/docs/payments/save-and-reuse?platform=web then create the Subscription. but it's more advanced integration and it's not the recommended way.
Cool. Thanks for all the help and clarity @green ivy . Appreciate it
You're welcome!