#sharpie89-cli
1 messages · Page 1 of 1 (latest)
@cosmic pawn you run it in two separate terminal windows usually
i.e you open one window/tab and run stripe listen , and in another window/tab, run stripe trigger charge.failed or whatever
Hm oki, how would this work with docker-compose?
I have a seperate service running image: stripe/stripe-cli
Is the idea to trigger events from the app container?
wouldn't you run the container and have it do the listen command, and then just trigger events from your development machine's local terminal?
(listen and trigger don't have to be run on the same host or instance of stripe-cli or anything, trigger just makes an event happen on your Stripe account and listen picks up events that happen on your Stripe account)
I don't really know your set up/overall goal though(and I have very little experience using Docker or containerisation myself)
I wanna test webhooks locally i think is my goal here
I don't know if stripe can call webhooks on local machines?
setup is laravel-cashier and my docker-compose has a stripe-cli service that's supposed to forward all calls to the app-service
Or lemme understand this clearly:
What stripe CLI does is basically the same thing stripe would do live, however, now it's in a docker container, so I can forward calls to my app?
is stripe CLI a middleman because my routes are local?
if stripe can call webhooks on local machines?
no because a webhook is a HTTP request our server makes to an external URL; so naturally we can't connect to like "localhost/webhook.php" etc.
That's why stripe-cli exists. You run it on your local machine and it establishes a connection with Stripe's servers, it receives the events and then forwards them locally to a local URL you specify https://stripe.com/docs/stripe-cli/webhooks
setup is laravel-cashier and my docker-compose has a stripe-cli service that's supposed to forward all calls to the app-service
sure, sounds sensible enough.
now it's in a docker container, so I can forward calls to my app?
I think so?
Ok that makes sense now, it's just an adapter for local machines
But it should be able to trigger events on command tho
hence my comment earlier about using two terminals
or in your use case:
wouldn't you run the container and have it do the listen command, and then just trigger events from your development machine's local terminal?
How does stripe know that I'm sending the command if I do that?