#aayush

1 messages ยท Page 1 of 1 (latest)

frosty flickerBOT
west pike
#

You could use one of our declined payments test cards: https://stripe.com/docs/testing#declined-payments. That in combination with test clocks should get you set up: https://stripe.com/docs/billing/testing/test-clocks.

Learn how to move Billing objects through time in test mode.

Use test cards to validate your Stripe integration without moving real money. Test a variety of international scenarios, including successful and declined payments, card errors, disputes, and bank authentication. You can also test non-card payment methods.

fiery lava
#

i have that setup just wanna know for a same customer how can i test it

#

for ex if his attempty is succesfull then for next billing date how can i test a failed case for that user?

west pike
#

You could use a test card for success for the first payment, then change the subscription's default payment method to the 4000000000000341 test card, which declines for payments after a successful attachment to a customer

fiery lava
#

how can i change subscription card for this customer?

west pike
#

How do you set the default pm currently?

fiery lava
#

my default payment right now is through checkout subscription page

west pike
#

Yeah you should be able to call the api I linked to override

fiery lava
#

sure thanks!

west pike
#

No problem

fiery lava
#

so is this

#

a webhook? that can be used to change a card detail for a customer?

west pike
#

No

#

It's the update subscription api endpoint

fiery lava
#

how to set this up?

west pike
#

There's a code sample on the right

#

You just need to pass default_payment_method

fiery lava
#

i see it comes in the response when sub is created

frosty flickerBOT
civic willow
#

Hi ๐Ÿ‘‹

I'm stepping in as @west pike needs to go. I see you are trying to update the default payment method and my colleague has provided you with the documentation you need. Is there anything unclear?

fiery lava
#

yes i just want to know about updating my subscription to test a payment fail scenario

#

all in all i want to change card details so that i can provide wrong card and attempt to test my scneanrio

civic willow
#

Okay, so my colleague pointed out you use the Update Subscription API with the code examples in the API reference doc we shared

fiery lava
#

yes

civic willow
fiery lava
#

so to change card details does it take card details as params ?

#

just to test the endpoint api

civic willow
#

No, I would recommend you use the Payment Methods like pm_card_visa_chargeDeclined