#flacoski-card
1 messages · Page 1 of 1 (latest)
Can you share the request ID (req_xxx)? Here's how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Thanks! Give me a few minutes to look into this.
Sure, I can wait
So it seems like unpausing the subscription succeeded, so it's expected that you are getting a 200 response. However the payment failed, so the subscription status is past_due.
Ok, how can I do to get a card declined error? And not succeeded the unpausing
The request to unpause the subscription will always succeed in this instance, the related payment failing is a completely separate action
And how can I do to get a Stripe::CardError when I try to unpause the subscription? I am trying to replicate a situation that happened some days ago when a user got a card declined error trying to unpause the subscription
Do you understand the cascading events that follow when you unpaused the subscription?
For example, a payment was attempted on the invoice after you unpaused the subscription (and it failed): https://dashboard.stripe.com/test/events/evt_1KVdJRLAcqx0q2FZ8iIeb6bF
This is likely what you need to track
Sorry for the delay.
Some days ago i got the Stripe::CardError trying to unpause the subscription, so I would like to get the error in that step instead of the 200 ok status
I don't know if I need a different Card or another settings to get this error
I doubt that error stemmed from that API request. Can you find the request ID?
As you can see in the screenshot from Sentry we are getting the error in that request. We don't do another request in that background job
Can you share the request ID?
req_qYIpphDH24BBXr
Checking on this
My initial guess is likely related to the test card you're using
Can you try unpausing a subscription where the default PM is a card that is expected to fail? https://stripe.com/docs/testing#cards-responses
Ok, i suspect something like that too
The issue is that I can not set up a card with card_declined code in the Stripe UI
for example, I can not add as a default card the 4000000000000002 card
i get that
you'd use the card ending 0341
I'm already using that card, but I'm getting 200 ok in the response
There's no default_payment_method set on that Subscription: sub_1KVd4qLAcqx0q2FZnVIeWeKC
Was unset because you unpaused it
How can I set up the default_payment_method on that sub?
The customer has that card as a default payment method. isn't that enough?
I think I already have the default payment method for the subscription
yeah that part is fine, never mind.
re-starting though, what's the issue? everything here is normal
you have a customer with the test card that declines
you unpause the subscription. That is one API request and it succeeds, that's normal
as a result of unpausing, we charge outstanding invoices
those fail async since the customer's saved default card is the one that declines, all expected
what am I missing?
my guess is you expected the call to unpause to fail for some reason?
yes, I am expecting the request fails as this request: req_qYIpphDH24BBXr
I mean, I am trying to get the same behavior to write a test
you're using different API versions
https://stripe.com/docs/upgrades#2019-03-14
Updates to a non-incomplete subscription that require a payment will also succeed regardless of the payment status. Prior to this version, all creations or updates would fail if the corresponding payment failed.
this is exactly the difference, it declines on the one request because it uses a 2018 API version, on the other, it succeeds and the failures are async
I am checking that right now
It looks like we are using an old version in Production
and the latest version Locally
Do you know how to set the version in a Rails code
?