#flacoski-card

1 messages · Page 1 of 1 (latest)

misty sphinx
rugged skiff
#

sure

#

req_eEvmuHTjdFRJq1

misty sphinx
#

Thanks! Give me a few minutes to look into this.

rugged skiff
#

Sure, I can wait

misty sphinx
#

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.

rugged skiff
#

Ok, how can I do to get a card declined error? And not succeeded the unpausing

charred horizon
#

The request to unpause the subscription will always succeed in this instance, the related payment failing is a completely separate action

rugged skiff
#

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

charred horizon
#

Do you understand the cascading events that follow when you unpaused the subscription?

#

This is likely what you need to track

rugged skiff
#

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

charred horizon
#

I doubt that error stemmed from that API request. Can you find the request ID?

rugged skiff
#

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

charred horizon
#

Can you share the request ID?

rugged skiff
#

req_qYIpphDH24BBXr

charred horizon
#

Checking on this

#

My initial guess is likely related to the test card you're using

rugged skiff
#

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

hardy ravine
#

you'd use the card ending 0341

rugged skiff
#

I'm already using that card, but I'm getting 200 ok in the response

charred horizon
#

There's no default_payment_method set on that Subscription: sub_1KVd4qLAcqx0q2FZnVIeWeKC

#

Was unset because you unpaused it

rugged skiff
#

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

hardy ravine
#

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?

rugged skiff
#

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

hardy ravine
#

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

rugged skiff
#

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

#

?

hardy ravine
rugged skiff
#

Great, That was really helpful. We will need to decide what we are going to do with the version

#

We didn't know about this issue

#

Thank you