#mattwoberts

1 messages ยท Page 1 of 1 (latest)

thick echoBOT
quiet trench
#

(It works if I test manually)

ruby spear
#

Otherwise, you should just stub/mock a response from Checkout to fit your testing stories

quiet trench
#

Can I add a test card through the API instead, that would be a reasonable workaround?

ruby spear
#

Well, what is it you're trying to test?

quiet trench
#

I want to get my customer to have a saved card against their subscription - I don't actually want to test anything on the checkout page

#

Once the customer has a card, I can test other things in the app... I thought that driving the flow through the checkout with cypress would be the simplest, but it doesn't work ๐Ÿ˜ฆ

#

If I can't add a card wholly via the API, can I have/get a checkout URL without requiring the need to create a checkout session first - I wonder if something in that flow upsets cypress....

ruby spear
#

If you need a payment method on a Customer object, use a Setup Intent. Otherwise, if you need a default_payment_method on a Subscription object then just use that field when creating your test subscription and use a test card token (pm_card_visa, for example)

earnest citrus
#

๐Ÿ‘‹ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

quiet trench
#

Sorry, was AFK, just catching up!

#

Ah - yes I can use those test card tokens can't I...

#

I'll try that route then I think - bypassing the checkout page entirely

earnest citrus
#

yes that would be your best option

quiet trench
#

Thanks for the help ๐Ÿ™‚

earnest citrus
#

let me know if you need any more help