#filopietra

1 messages · Page 1 of 1 (latest)

wild muralBOT
peak beacon
#

General practice would be to add multiple events to the same webhook, assuming they're all handled by the same endpoint

ionic vector
#

got it

#

would I have to re-initialize the webhook when I add the new event?

peak beacon
#

What do you mean?

ionic vector
#

so the webhook URL. Initially bubble provides it with /initialize at the end

#

but after the data is sent, I have to remove the /initialize

peak beacon
#

I'm not really sure how that works with Bubble. Generally once you add the new events to the webhook, then it'll start receiving them without any extra configuration from your side

#

Obviously you need to add your own logic to handle the new events

ionic vector
#

okay thanks

wild muralBOT
ionic vector
#

the only problem is that by adding the new event to the current webhook, it's not getting called

#

For instance, I updated and then canceled a subscription but the correct event is not here

#

(sorry not a developer so some terminology might be off)

#

if I cancel it manually from stripe, the subscription_status gets updated correctly

#

but if I do it from my application, it doesn't

#

any other recommendations on how to properly set up this webhook?

steady seal
ionic vector
#

evt_1N4MKTCaqB9tXft17iaCaQOt

#

do you also need the webhook id?

steady seal
#

This event is for subscription updated, I meant the request id of the call you made from your application to cancel the subscription.

#

Who is the maintainer of that application, if you aren't a developer ?

ionic vector
#

I am partly the "developer" but since bubble is a low-code tool, I built everything using online resources

steady seal
# ionic vector This?

No I need the requestId of the API call that canceled the subscription and you didn't receive an event for

ionic vector
#

so, when I clicked on "cancel subscription" on the customer portal, the subscription got canceled but the wrong event in the webhook got triggered (with the ID I sent above). If I go ahead and force it from Stripe's dashboard, then the correct event gets triggered:

#

here I tried multiple times

#

I am tracking the changes on this simple webpage from our app on Bubble

#

the subscription status always remains active (except when I cancel from Stripe's admin)

steady seal
#

Let me do a quick test.

ionic vector
#

thanks!

#

do you need any more info?

steady seal
#

Actually when canceling a Subscription using the customer portal you receive just customer.subscription.updated yes, you'ill have the field cancel_at populated in the update with the date of the cancel action.

ionic vector
#

but the status is not updated..

#

so I am unable to display that information in the customer's profile page

steady seal
#

In the customer portal are you seeing that the Subscription is canceled ?

#

You should have something like this

ionic vector
#

sub_1N4MElCaqB9tXft1J2BCjscK this is the subscription I am testing

ionic vector
#

and this on Stripe

#

so I see that it is set to cancel at the end of the billing cycle

#

does that mean that until then the status will remain "active" and then switch to "cancelled" after the 5th of June?

ionic vector
#

ahh I see

#

perfect

#

so the correct webhook event will be triggered on that date?

steady seal
#

Yes.

ionic vector
#

is there a way to test this? As in, speed it up so I can check that the status is indeed changing to cancelled

patent turret
#

Hi there 👋 jumping in as my teammate needs to step away soon.

ionic vector
#

I see

#

it all worked!

patent turret
#

Awesome! 🥳 glad to hear

ionic vector
#

while I'm here, is there a way to deploy all of the settings/set ups without re doing everyhting from scratch?

#

so move from test mode to live mode

#

for customer portal, pricing tables, products, webhooks etc

patent turret
#

I don't think there is a way to copy all of those.

Products can be copied from test to live mode from their dashboard page, but I believe the other components will all need to be recreated.

ionic vector
#

ah that's not ideal

#

So then I would have to initialize the webhooks with real transactions

#

or can I still use a dummy card when Stripe is not on test mode?

patent turret
#

Test cards can only be used in test mode.

ionic vector
#

hmm

#

If I have to create a new production webhook, I would have to run multiple test and "spend" a lot of real moeny

#

money

#

what is the best practice here?

patent turret
#

The best practice is to thoroughly test in test mode, and then copy the code over to production once you're confident it behaves as you're expecting.

ionic vector
#

So for this webhook for example, should I just remove the "version-test" part of the URL (which is used for testing in bubble) and copy over the URL to the live mode?

#

Or do I have to do everything from scratch?

#

as in, re send the payload etc

patent turret
#

I'm not sure, I'm not familiar with how Bubble works. I don't know if they have the concept of test/live environments. If you have a separate live endpoint in Bubble, then you would want to create the webhook endpoint in livemode so that it points to that URL.

I would advise against using your test endpoint for production purposes, as that means you would need to build a new test endpoint if you ever wanted to test out new functionality.

ionic vector
#

so you recommend having a production webhook set up in test mode on Stripe?

#

on bubble, if you add /version test right at the beginning of any URL, you will run that page in test mode

patent turret
ionic vector
#

okay understood

#

thanks!

patent turret
#

Any time!