#chalmagean
1 messages · Page 1 of 1 (latest)
I mean a callback...
I do get one when I create the subscription
but not on update
What exactly do you mean by "callback"? Can you give an example?
end endpoint that gets called with a POST request
after the subscription was created
which is separate from the events
sorry... a GET request
here's an example
Started GET "/api/v1/checkout_callback?checkout_session_id=cs_test_a1eH2Sgc3oXkN6XlCZwACXGfOPxfYVfpvWUjMqbu7MkJa7Q9bVlJ0iUhQ4" for 127.0.0.1 at 2023-02-10 13:50:22 +0200
I'm sorry but I don't understand your question. You mentioned callback, POST request, GET request. What exactly are you trying to do?
I create a checkout for a new subscription and then I get a callback (GET request from Stripe)
When I update the subscription (via the customer portal) I don't seem to get a second callback (GET requrest)
I do get a few POST requests though for various events
is that the correct behavior? I'm not sure why that second callback (GET request) is missing
👋 stepping in
Still not sure I understand exactly. You are expecting the customer portal to generate a GET request?
yeah, I'm sorry my question wasn't very clear
when creating the checkout URL, I'm passing in a success_url
so the question is, can I somehow get a call to the same url after someone updates their subscription?
or should I just rely on webhooks
I'm having some trouble in a testing environment, I don't think those events get streamed there
they work fine in development if I use the Stripe CLI to forward them to a local endpoint
but how would I do that on a test env?
They definitely should get generated in test
You need an HTTPS endpoint if you aren't forwarding via the CLI
I have a dynamic URL (gets generated with each new branch)
it's a HTTPS url that looks like this: https://kinscape-ch-bug-update--jz1tjh.herokuapp.com
Okay
And do you have a Webhook endpoint set up in your Stripe account with that URL?
Hmmm yeah I don't think that will really work afaik. You need a static endpoint for webhooks.
Why is it dynamic exactly?
for reviewing (QA) new features
each new features gets a new review app
with a generated URL
before they get merged to staging
Ah okay well then you want to dynamically generate a new endpoint in your staging account each time
So you call https://stripe.com/docs/api/webhook_endpoints/delete to delete the current one and then https://stripe.com/docs/api/webhook_endpoints/create to create a new one
Then you run your tests
ah, ok, that makes sense
thanks for your help
Sure thing