From ee0682ad26b29bb30e6b2f1cb5d7dfd781fff28a Mon Sep 17 00:00:00 2001 From: MelissaCole Date: Thu, 15 Jan 2015 16:59:43 -0800 Subject: [PATCH] Fix stripe secret being nulled when renewed --- r2/r2/controllers/ipn.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/r2/r2/controllers/ipn.py b/r2/r2/controllers/ipn.py index 6267e6a73..9d41c1570 100644 --- a/r2/r2/controllers/ipn.py +++ b/r2/r2/controllers/ipn.py @@ -627,11 +627,6 @@ class IpnController(RedditController): # and "custom", just in case we need to debug it later or something secret = payment_blob['goldtype'] + "-" + custom - if payment_blob['goldtype'] == 'autorenew': - existing = existing_subscription(subscr_id, paying_id, custom) - if existing: - secret = None - if instagift: status="instagift" else: @@ -845,6 +840,10 @@ class GoldPaymentController(RedditController): message = ("see the details of your subscription on " "[your userpage](/u/%s)" % buyer.name) + if payment_blob['goldtype'] == 'autorenew': + if existing_subscription(subscr_id, paying_id, custom): + secret = None + elif goldtype == 'creddits': buyer._incr('gold_creddits', months) subject = "thanks for buying creddits!"