From 0ae5072a9102cbda206d317005f04a7b8632ce85 Mon Sep 17 00:00:00 2001 From: Brian Simpson Date: Mon, 5 Jan 2015 16:46:52 -0500 Subject: [PATCH] CoinbaseController: cleanly ignore non-payment events. --- r2/r2/controllers/ipn.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/r2/r2/controllers/ipn.py b/r2/r2/controllers/ipn.py index 9c879fa74..bb1454724 100644 --- a/r2/r2/controllers/ipn.py +++ b/r2/r2/controllers/ipn.py @@ -1189,12 +1189,18 @@ class CoinbaseController(GoldPaymentController): 'cancelled': 'cancelled', 'mispaid': 'noop', 'expired': 'noop', + 'payout': 'noop', } abort_on_error = False @classmethod def process_response(cls): event_dict = json.loads(request.body) + + # handle non-payment events we can ignore + if 'payout' in event_dict: + return 'payout', None + order = event_dict['order'] transaction_id = 'C%s' % order['id'] status = order['status'] # new/completed/cancelled