#djones-setupintent-testing

1 messages · Page 1 of 1 (latest)

tawny hawk
lapis hawk
#

we tried the Decline after attaching card but the setup succeeds. For this scenario we are not charging the card b/c we're adding a subscription w/ a free trial. Stripe creates a setup intent and that setup intent is not failing with this card. We are wanting that setup intent to fail.

#

The other test "card decline cards" return an error prior to Stripe creating the setup intent

tawny hawk
#

Can you show me the requests you're making?

frosty jackal
#

@tawny hawk - we are not actually creating the setupIntent on our side. Here is our flow:

#
  1. We tokenize the car in the browser.
#

2.Then send the token to the server where we create the customer and attach the card.

#
  1. We then create a subscription for the customer and add the plan for our subscription product. That plan has a 10 day free trial on it.
#

We never create the setup Intent. With Stripe, if the plan has a free trial it will create the setupIntent on its own. We have a use case where that setupIntent can sometimes fail (expired card, cvc, etc) in production and need to test our fix against that.

#

But we can't figure out how to provide our dev env a card that will allow the attachment to the customer... but when we create the subscription on the customer have the setup intent fail (again setup intent is created by stripe not us)

#

We tried the card david mentioned above that allows the attachment to the customer but will fail on subsequent charges... but that doesn't work for us as we are not charging the card.. because of the free trial the card doesn't get charged. A setup intent is created and that setup intent passes. You would think the setup intent would fail using that card number but it doesn't.

tawny hawk
#

Ah I see what your issue is - so there's a trick here where you can attach declining cards to a customer by specifying validate: false when you attach them. I assume that'w why you're having trouble using the other declining test cards. If you use validate: false that'll allow you to add it to the customer, adn then continue on with creating the subscription

frosty jackal
#

So we need pass validate: false on the customer create when providing the source?

#

or is that on the tokenization in the browser using the stripe.js api?

tawny hawk
#

When you customer create + provide the source

frosty jackal
#

I don't see a validate param in the strip api docs on customer create. Is that just a hidden param (not documented?)

tawny hawk
#

Yeah it's undocumented

frosty jackal
#

ok, we'll try that real quick.. brb

lapis hawk
#

thanks that worked!