File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -322,7 +322,18 @@ def resume_paused_subscription(
322322 # We can just wait for it to start as normal
323323 return False
324324
325- subscription = retry (lambda : stripe .Subscription .retrieve (subscription_id ))
325+ try :
326+ subscription = retry (lambda : stripe .Subscription .retrieve (subscription_id ))
327+ except InvalidRequestError as e :
328+ if e .code == "resource_missing" :
329+ # The subscription was deleted.
330+ # We might have missed the webhook to delete the reference from the member.
331+ # Or the webhook might be on its way.
332+ # Treat this as if there is no subscription.
333+ return False
334+ else :
335+ raise
336+
326337 # If the subscription is not paused, we can just do nothing.
327338 if subscription ["pause_collection" ] is None :
328339 return False
You can’t perform that action at this time.
0 commit comments