#Piercy
1 messages · Page 1 of 1 (latest)
Hi
You are using a card that triggers a decline after attaching 4000000000000341
Use another card (e.g. 4242)
https://stripe.com/docs/testing#declined-payments:~:text=Decline after attaching
Were deliberatately testing a failure
We think the functionality has changed that it now throws and exception, when previously, it would return an object that contained details about the failure.
That's depends on how you are implementing/handling failure. in the request req_YVx2tEkMdegmOm you have the object that contains the details of the failure
previously we would call the node library paymentIntents.create. That would return an object, and then we look inside that object to check whether the payment intent was successful, and if it failed, for what reason.
Now, we call paymentIntents.create and an exception is thrown from the library, so there's no object to check.
We can obviously, make an API call, to get the payment intent again, but from our perspective it looks like something has changed, from returning an object to throwing an exception?
To give you some insight, from what we can tell, this has been running since February 2020, and we have suddenly seen an issue with exceptions being thrown from this.
Doing a quick test....
Yes so you need to catch the exception, and in the exception object you'll have more details about the error:
https://stripe.com/docs/error-handling?lang=node#catch-exceptions
Yeah, i think thats going to be the approach we take, but i will say this looks like new behavior.
Were now seeing exceptions regularly, where as previously it was objects. It could just be unfortunate timing, but since around april 19th, exceptions have risen
Just refactor your code, catch exceptions and inspect them.
i will do that, but i also have to go to my boss and explain why the functionality thats been working since 2020 has now failed for a bunch of people
considering we hard set the API version, and have hard set the library version, we aren't expecting things to change - yet it seems the have
That depends what Stripe Nodejs library you are using and what changes was made since 2020.
Well indeed, but if we haven't upgraded the version why would it change? I thought that was the whole reason behind api versioning? https://stripe.com/docs/api/versioning
This has no link to API version, SDKs are wrappers to API calls. This is how the SDK is managing API responses. Again, I have a doubt about what you are saying that before the SDK isn't throwing an exception and now it's throwing without changing any think in your integration/code.