Clear secret for recurring subscription payments

This commit is contained in:
MelissaCole
2015-01-13 13:44:39 -08:00
parent 61850e958a
commit e7d2d1806c
2 changed files with 8 additions and 3 deletions

View File

@@ -56,7 +56,7 @@ from r2.models import (
Account,
account_by_payingid,
account_from_stripe_customer_id,
accountid_from_paypalsubscription,
accountid_from_subscription,
admintools,
append_random_bottlecap_phrase,
cancel_subscription,
@@ -201,7 +201,7 @@ def existing_subscription(subscr_id, paying_id, custom):
if subscr_id is None:
return None
account_id = accountid_from_paypalsubscription(subscr_id)
account_id = accountid_from_subscription(subscr_id)
if not account_id and has_blob(custom):
# New subscription contains the user info in hardcache
@@ -627,6 +627,11 @@ 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:

View File

@@ -247,7 +247,7 @@ def all_gold_users():
data=True, sort="_id")
return fetch_things2(q)
def accountid_from_paypalsubscription(subscr_id):
def accountid_from_subscription(subscr_id):
if subscr_id is None:
return None