mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-23 05:48:11 -05:00
Clear secret for recurring subscription payments
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user