#xlex
1 messages · Page 1 of 1 (latest)
Hi, do you mean redirect after the completion? Or something else?
Yes, redirect after completion.
In a browser, Stripe redirects back to our site and I can retrieve the session to check that it's paid. I basically want to test retrieving a paid session.
You can retrieve the session: https://stripe.com/docs/api/checkout/sessions/retrieve. You can listen to checkout.session.complete event: https://stripe.com/docs/api/events/types#event_types-checkout.session.completed
Is there a way to make the session complete without opening a browser at all? What I'm hoping to do in my tests is...
session = Stripe::Checkout::Session.create({some_magic_param_to_auto_approve})
Stripe::Checkout::Session.retrieve(session.id)
Basically I want to test the entire checkout::session flow on my server backend, without needing manual intervention
You can't do that. You can use these test cards: https://stripe.com/docs/testing#cards