mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-02-02 18:55:32 -05:00
Stripe: more informative error message for unrecognized event types.
This commit is contained in:
committed by
Chad Birch
parent
ab980f1ad3
commit
9b037e0a8f
@@ -709,7 +709,10 @@ class StripeController(GoldPaymentController):
|
||||
event_dict = json.loads(request.body)
|
||||
event = stripe.Event.construct_from(event_dict, g.STRIPE_SECRET_KEY)
|
||||
status = event.type
|
||||
if cls.event_type_mappings.get(status) == 'noop':
|
||||
event_type = cls.event_type_mappings.get(status)
|
||||
if not event_type:
|
||||
raise ValueError('Stripe: unrecognized status %s' % status)
|
||||
elif event_type == 'noop':
|
||||
return status, None, None, None, None
|
||||
|
||||
charge = event.data.object
|
||||
|
||||
Reference in New Issue
Block a user