#Uche-stripe-tax
1 messages · Page 1 of 1 (latest)
Hi there! I'm a bit confused.... you are seeing a card error, right? That indicates the payment failed, no?
Can you provide an example PaymentIntent ID that you tested with?
I just tested it again and it does fail with a card error
payment id pi_3Kpz5BJOFr5bbosl1LrKvVWq
Yep, is there something that is unexpected here?
I guess not. We weren't using the cardError to terminate the flow before because we integrated avalara for taxation. we used "pay_immediately=False" to give avalara time to add tax line items and relied on the payment failed webhook to cancel memberships.
So i guess the questions i am asking are:
- is cardError a reliable indicator to break the payments flow and not create a membership for a customer?
- Are there many other things besides a failed payment that can cause a cardError? You can point me to the right docs if need be. Thanks
The best way to create a membership is to track the Subscription status: https://stripe.com/docs/api/subscriptions/object#subscription_object-status, not to worry about the PaymentIntent itself. When the Sub is active, you provision.
When it moves to past_due (from a failed payment on a renewal), then you decide how you want to handle.
https://stripe.com/docs/billing/subscriptions/overview is a good thing to read through if you haven't yet.
So basically, The subscription must always be created even if a card fails and then the status would indicate success or failure?
Hello. Taking over for bismarck as they have to step out. Give me a bit to catch up
ok sure
The subscription should always be there any you can check its status. What integration guide/flow are you using? Checkout/PaymentElement?
But I recommend looking at this article specifically for webhook events: https://stripe.com/docs/billing/subscriptions/webhooks
So we currently let customers buy subscriptions which gives them access to certain products in form of memberships
we have the webhooks setup right now and it works fine
we were using avalara for tax integration so we added a delay in charging to allow avalara add its tax in the invoice
Which means the subscription must be created while waiting to know if the payment failed or not from the webhooks
Right now we were thinking that using stripetax, when a card charge fails, the subscription wont even be created at all
When you say subscription must be created, you mean you are giving the customer access to your service in that in between period?
So, to recap, you currently provision your service for the user and give them access to your service before you actually charge them (to give avalara time to add its tax in the invoice). If payment fails, then you want to de-provision the service. For the payment intent you shared, I see an invoice.payment_failed event was generated actually: https://dashboard.stripe.com/test/events/evt_1Kpz5DJOFr5bboslxcUL26rI. You should be able to use that still
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Yes the assumption that it wasnt fired was my own mistake from an initial test. I currently use the payment_failed webhook. I just wanted to know if there was a way for the payment to fail in a way that the payment doesnt even go through at all
and no subscription is created
and i wont have to depend on the webhook to now cancel an already created subscription or membership
If there are any issues with charging the card on file, then invoice.payment_failed will always get generated
Ok. So you would suggest we stick to using the webhooks as the source of truth for failure? or can we just use the cardError as proof of failure break the process?
Currently we just log a message when a cardError is raised for traceability purposes
We always recommend using webhooks. Again, I recommend giving this guide a thorough read for all the different cases you might need to handle: https://stripe.com/docs/billing/subscriptions/webhooks
Which events you need to listen to might differ depending on your integration, but that guide outlines everything you should make a note of
ok thanks a lot i'll go through it