#chalmagean

1 messages · Page 1 of 1 (latest)

ruby sandBOT
dense elbow
#

Hi there!

#

Do you mean webhook events? If so, yes!

gentle rampart
#

I mean a callback...

#

I do get one when I create the subscription

#

but not on update

dense elbow
#

What exactly do you mean by "callback"? Can you give an example?

gentle rampart
#

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
dense elbow
#

I'm sorry but I don't understand your question. You mentioned callback, POST request, GET request. What exactly are you trying to do?

gentle rampart
#

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

ruby sandBOT
subtle coral
#

👋 stepping in

#

Still not sure I understand exactly. You are expecting the customer portal to generate a GET request?

gentle rampart
#

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

subtle coral
#

Ah thanks for clarifying

#

Yeah you would rely on webhooks

gentle rampart
#

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?

subtle coral
#

They definitely should get generated in test

#

You need an HTTPS endpoint if you aren't forwarding via the CLI

gentle rampart
#

I have a dynamic URL (gets generated with each new branch)

subtle coral
#

Okay

#

And do you have a Webhook endpoint set up in your Stripe account with that URL?

gentle rampart
#

I don't think I do, since the URL changes

#

I only know the path

subtle coral
#

Hmmm yeah I don't think that will really work afaik. You need a static endpoint for webhooks.

#

Why is it dynamic exactly?

gentle rampart
#

for reviewing (QA) new features

#

each new features gets a new review app

#

with a generated URL

#

before they get merged to staging

subtle coral
#

Ah okay well then you want to dynamically generate a new endpoint in your staging account each time

#

Then you run your tests

gentle rampart
#

ah, ok, that makes sense

subtle coral
#

Overall though you should just be mocking data here

#

Not hitting the API for tests

gentle rampart
#

no I mean manual tests (QA)

#

not automated tests

subtle coral
#

Gotcha

#

Then yeah that's fine

gentle rampart
#

thanks for your help

subtle coral
#

Sure thing