From 42bf5b2cedf8c40ef2563638fbc91460111a0aed Mon Sep 17 00:00:00 2001 From: Brian Simpson Date: Sun, 17 Nov 2013 04:30:27 -0500 Subject: [PATCH] StripeController: handle charge.failed with insufficient information. --- 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 f1383c880..b366417f3 100644 --- a/r2/r2/controllers/ipn.py +++ b/r2/r2/controllers/ipn.py @@ -796,6 +796,12 @@ class StripeController(GoldPaymentController): # we'll get an additional failure notification event of # "invoice.payment_failed", don't double notify return 'dummy', None + elif status == 'charge.failed' and not description: + # create_customer can POST successfully but fail to create a + # customer because the card is declined. This will trigger a + # 'charge.failed' notification but without description so we can't + # do anything with it + return 'dummy', None elif invoice_id: # subscription charge - special handling customer_id = charge.customer