#spencerjoel-subscriptions

1 messages · Page 1 of 1 (latest)

thorny dirge
#

Hi! Can you share the subscription ID that shoul dhave triggered the subscription.deleted event?

eternal nebula
#

sure, 2 seconds...

#

heres one of them...
sub_1Km2LOPdqhLiorxkA7vlqRZR

#

and another
sub_1Km2FVPdqhLiorxkTPJi891K

thorny dirge
#

Thanks! Give me a few minutes to look into this.

#

For the firs subscription, it looks like the event customer.subscription.deleted was triggered: evt_1Km2M7PdqhLiorxk1C6rWoWt

#

And your webhook we_1KkNoEBRghsiakRamL7iQzSz returned a 200 response to the Stripe event.

#

It's the endpoint https://***.com/wp-content/plugins/cpd-pay/stripe_webhooks.php that was called

#

So from our end everything worked as expected.

eternal nebula
#

Sorry, have I given the wrong ID, let me check

#

Ok, so this is weird. Those subscriptions are created in test mode but the webhook that has sent the event is a live webhook

#

I can indeed see all the events in the live webhook, but not in test, even though these are transactions and subscriptions created n test mode

#

could you check this subscription please: sub_1Km2LOPdqhLiorxkA7vlqRZR

this one was cancelled, in test mode last night

thorny dirge
#

Yes, this is odd but actually expected:

For Connect webhooks, it’s important to note that while only test webhooks will be sent to your development webhook URLs, both live and test webhooks will be sent to your production webhook URLs. This is due to the fact that you can perform both live and test transactions under a production application. For this reason, we recommend you check the livemode value when receiving an event webhook to know what action, if any, should be taken.
https://stripe.com/docs/connect/webhooks

eternal nebula
#

Ah I see....
Previously I was testing and I was recieving these events on the test webhook, is this because it was before I had created the live webhook?

thorny dirge
#

test webhook events should be sent to both test and live webhook endpoint.

eternal nebula
#

I see, so is there a reason why the lasest event on our live webhook (from test) are not in our test webhook?

worldly spruce
#

That sentence is confusing. Can you share the Event ID?

eternal nebula
#

Sorry! yes of course!

event_id: evt_1KmDKqPVjMlLacJb8gzwj7TI

This event was the event triggered when cancelling a subscription. The subscription was created in test mode and appears in the test data of a connected acocunt

cancelling the subscription triggers the subscription.deleted event in the live webhook endpoint (we_1KkNoEBRghsiakRamL7iQzSz) but did not send an event in the test webhook endpoint (we_1Km2ErBRghsiakRaSJaRrbWt)

worldly spruce
#

Got it. Checking something!

#

Ok yep. Connect webhooks are a bit of a minefield. Issue here is that the connected account only has a live mode connection to the platform

eternal nebula
#

Ah, I see! That makes sense. That explains why all was working well when we were initially testing and then fails when we try to test using the account created by a real customer

Thank you guys, explains the problem perfectly, as always top notch support from Stripe!!!

worldly spruce
#

Sure, np!