#vancouver_trader-recurring-payment-testing
1 messages · Page 1 of 1 (latest)
Hey there 👋 are you looking to test the payments failing/being declined initially, or them failing later on?
failing later on
The way I test this scenario is to create a subscription with a trial period and use our test card that ends in 0341 . This card will attach to the customer successfully, allowing the trial to start, but will fail when the first charge is attempted.
4000 0000 0000 0341
And you can update the trial_end field on the subscription to force this to happen rather than having to wait for the trial to expire on its own.
https://stripe.com/docs/api/subscriptions/object#subscription_object-trial_end
Perfect sounds good
Also one last question..how can I find transaction status ?
Like transaction was susscessful, failed or declined etc.
Is this just for your testing? Or is this a check that would need to be part of your production code base?
eventually will be part of prod
Gotcha. You have a couple options, one of those is to create a webhook endpoint to receive event data, and subscribe to charge events.
https://stripe.com/docs/webhooks
https://stripe.com/docs/api/events/types#event_types-charge.captured