Fix stripe secret being nulled when renewed

This commit is contained in:
MelissaCole
2015-01-15 16:59:43 -08:00
parent 8ef7766336
commit ee0682ad26

View File

@@ -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!"