#vineet5769
1 messages · Page 1 of 1 (latest)
hi! do you have details on how you integrate exactly?
do you have an ID of a CheckoutSession cs_test_xx where this happened?
do you have a link to your page where I could replicate this?
I can share the ids but cannot share the test link as it is an organization testing link.
cs_test_a1o2P2fFeZMH0LxMRxNj1m5E5Y5F1oRZZQiiRIPp1R3SBxUbv2RaculTF9
cs_test_a1gt4Mcd0kfln4KKnEblTOgBs94kg2NXOTT3AeS1AFLGYHZlABYPsP0to8
I'm using stripe api version. I've not made any changes to the code which was working fine previously, and I'm using version = '2020-08-27', so even this should not create any problem irrespective of any changes in latest versions in stripe.
I think it's because you have this weird API call that deletes the Subscription object while the CheckoutSession is running : https://dashboard.stripe.com/test/logs/req_xwB1seTlcLiURI
I suggest looking into what webhook listeners you might have or some services you might be running on Google AppEngine that you might have forgotten about and that are making these API calls
I checked everything already and it seems this issue is not from our side.
The API call that you see deletes previous subscription is when we receive webhook associated with invoice.payment_failed
then I'd suggest reaching out to https://support.stripe.com/?contact=true ! maybe it's an issue with out captcha implementation and we need to investigate
The API call that you see deletes previous subscription is when we receive webhook associated with invoice.payment_failed
did you try removing it for now?
like just to check if maybe it is the problem? 🙂 if you try and it doesn't change anything and the error still happens, then fair enough, but worth trying.
If a payment fails, our ideal solution is to delete the subscription so that no retries occur.
But sure, I will check by removing it once.
It got resolved, but may I please know why invoice.payment_failed event is triggered first. Following that, charge.succeeded , invoice.payment_succeeded and checkout.session.completed event are also triggered.
sub_1NYS7BKBKFciBNc7Almpc0tH
probably because the payment attempt initially fails if a captcha is required , and then it succeeds when the captcha succeeds
It seems the captcha verification is triggering the payment failed event
you should not cancel a subscription based just on an invoice.failed event
for example, you should check the billing_reason of the Invoice first, and ignore it if the reason is subscription_create https://stripe.com/docs/api/invoices/object?lang=java#invoice_object-billing_reason
in your current implementation you will just break Checkout(you cancel the subscription it's trying to use if there's any failure on the page, when it's not expecting that to happen)
But then what about the case when payment fails for the user and the subscription is still active in Stripe?
I do not want automatic retries for first time payments in a subscription.
Is there something we can do to disable captcha?
not sure what you mean
like think about the scenario. I come to your page. I go to Checkout. I make a mistake and have a typo in my card number. It's declined. I try again. I pay successfully
do you want me to not be able to do that? because right now that's kind of what you're doing since you cancel the Subscription immediately
there are no automatic retries
Understood your point.
overall you should ignore any events that are coming from Checkout until it's finished, and you can identify that with billing_reason
Can I delete subscription in case of checkout.session.expired event?
Any idea how to identify the case when checkout is complete and payment did not go through?
One more question - when was captcha introduced in Stripe Checkout?
I guess, but you don't have to. They delete themselves if the subscription was not activated in 23 hours after the start of the attempts
that case can't happen, if you get a checkout.session.completed event it means the payment succeeded and the subscription is active
recently
Thanks for your help, I started working on Stripe like 3-4 months ago and still there are a lot of uncovered areas. I guess I will learn slowly.