#wpgjetsfan13_webhooks

1 messages ยท Page 1 of 1 (latest)

restive pebbleBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1288954405978247261

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

fickle robin
#

The reason for my question is we don't currently handle customer deletion because it wasn't something we expect to happen in production. But since these auto-deletions cause issues in our test environment, we are wondering if we can handle it with a webhook. But it's not clear to me if Stripe will send us a webhook when deleting a customer with subscription test clock after 30 days.

#

And I have to wait another month for the next automatic deletion to occur, so I can't really verify it

neon kernel
#

Hi there ๐Ÿ‘‹ I'm not sure I'm grasping what you're asking. customer.deleted Events are generated when Customer objects are deleted, and are not related to the deletion of a Customer's Subscription.

fickle robin
#

We had a customer in our test environment that was automatically deleted by Stripe, not by us

#

And it generated a customer.deleted event. We were trying to figure out what had happened, and then I found this article: https://support.stripe.com/questions/test-mode-subscription-data-retention

#

It says Stripe will automatically delete subscriptions and the associated customer for that subscription after 30 days in test mode, if there is a test clock attached

#

And I can see this customer.deleted event when I search, but in this article, it says webhooks will not be sent.

#

So the issue is, we have customer id references in our database that suddenly become unusable

#

We could handle it with customer.deleted webhook, but that article says webhooks will not be sent when subscriptions are auto-deleted by Stripe. I'm just wondering if that means 'subscription webhooks' will not be sent or all webhooks will not be sent

#

Because I see the customer.deleted event in Stripe, so I'm confused what is the truth. Will it send or not?

#

And I cannot test it because it only happens when Stripe auto-deletes, and this doesn't happen very often

#

hopefully that clarifies what I am asking

neon kernel
#

I don't see any mention in that article that the Customer object will be deleted as well. My suspicion is that the Customer was in a test clock and that the Test Clock was deleted, but I'm still looking to try to confirm that.

fickle robin
#

Sorry, it's under the heading: 'How will subscriptions created using test clocks be affected by this new policy?'

#
Test clocks and their customers are deleted automatically 30 days after creation, while any associated subscription is cancelled when the test clock is deleted
#
Will a webhook be sent when a non-exempt subscription is auto deleted?

No, webhooks will not be sent when subscriptions and subscription schedules are deleted automatically in test mode.
neon kernel
#

Hm, that reads to me like just the Subscription events aren't sent.

#

Looking to see if we have an article on the test clock retention policies.

fickle robin
neon kernel
#

Yes, every event generated would be sent to any endpoint listening for that event. Which is why I think the distinction between customer.deleted and customer.subscription.deleted is important here.

fickle robin
neon kernel
#

Oh interesting, maybe I'm mistaken. Do you have the IDs for those Events?

I'm also wondering if there is a bit of a nuance here between the test clock retention policy and the more broad testmode subscription retention policy.

fickle robin
#

Yes:
evt_1PvPHvBoPT69D2q9HtEmqeHj
evt_1PvPHvBoPT69D2q9DbVZ8beK
evt_1PvPHuBoPT69D2q9pJkXd8h0

#

But to be honest, if this is correct: Yes, every event generated would be sent to any endpoint listening for that event. then it answers my question I think. Because that was what my question really boiled down to, was whether I could trust that any events that I can see would be delivered to any listening webhooks. I just didn't know if there was some special behaviour for this specific case

#

I just couldn't verify it without waiting for it to happen again on Nov. 24

neon kernel
#

Gotcha. As far as I'm aware they will. One thing you can try, is creating a test clock with a customer and subscription, and then delete the test clock yourself. I'm not exactly certain it'll trigger the same as our automatic cleanup, but it's the closest thing that comes to mind that you could trigger quickly.

fickle robin
#

interesting, I'll try it out. thanks for the help and clarification!

neon kernel
#

Any time!