#rob.clayton
1 messages · Page 1 of 1 (latest)
I think it could be possible yes, but what exactly is the error you are facing? Do you have a request id req_xxx
Hi @hexed sail I'm taking over this thread
I've been trying a few different things, but basically I just want to use test data, with an existing account with an existing subscription with a new phase that will have this new default ach payment method and I want it to automatically suceed.
I'm fine with adding the phase with a test credit card, but not with an ach payment for testing
that is a us bank account
I have appropriate line items and a payment method.
"pm_card_visa" works fine ... but I can't work out how to test from the BE (python) for ach us bank accounts
Can you tell me why you don't want to use Stripe UI to for ACH debit payments? (https://docs.stripe.com/payments/ach-debit/accept-a-payment?platform=web&ui=API) ACH debit requires mandates from customers, and Stripe UI can help you collect them.
Yes, because I want to make repeated tests, and creating the environment means I use a test clock, add the data, configure everything, then forward the clock.
Very tiresome to actually have to manually setup this test environment.
If it's only for test purpose, you might want to use https://github.com/stripe/stripe-mock to mock API responses.
So I prepare everything through python code by:
creating a test clock
adding a customer
creating a subscription
adding a phase
forwarding time to when the phase will be migrated to the subscription to see how our webhook works
That won't work for the actual webhook call we are actually testing though
I still don't understand why you want to test against Stripe API?
what I'm actually testing is the webhook we are implementing on an ach payment_intent where we need to do some custome work.
So I need a valid payment intent, and I felt the best way to process everything was using stripe in test mode and actually going through each step and receiving a "real" webhook call for a "real" customer behind a time clock
Then why not testing with mocked webhook events? so that your tests doesn't need to rely on external API
These aren't unit or integration tests, I'm wanting to test in a "real" environment to see how things interact with a full environment.
However, if I just want mocked data, what's the best way to get a "valid" set of data to trigger to my webhook?
You can just copy the data from an existing webhook event and use it in your test.
yeahhhh ... part of why what I've been using successfully with a fake credit card is all the time data is correct for what my test clock is set to with the data.
So I take it I can't use the BE in a stripe test environment to get back an automatically validated US bank account?
If not, I'll do as you suggest
You can, but it just require more work.
https://docs.stripe.com/payments/ach-debit/migrations#mandate-acknowledgement you can use this approach to collect mandate from backend if you don't have a FE to collect mandate