Skip to content

Commit

Permalink
enable configuring paypal secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshData committed Jul 31, 2017
1 parent 647e164 commit d97a04e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions settings.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,6 @@ GOOGLE_APP_ID=fill this in
GOOGLE_APP_SECRET=fill this in
GOOGLE_AUTH_SCOPE="openid email"
SPARKPOST_API_KEY=fill this in
PAYPAL_CLIENT_ID=fill this in
PAYPAL_CLIENT_SECRET=fill this in
PAYPAL_CLIENT_MODE="sandbox" or "live"
10 changes: 7 additions & 3 deletions settings_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ def get_env_boolvar(var_name, default=NOT_SET):
"TWITTER_ACCESS_TOKEN", # for automated tweets and to update @GovTrack/Members-of-Congress twitter list
"TWITTER_ACCESS_TOKEN_SECRET",
"SPARKPOST_API_KEY",
"PAYPAL_CLIENT_MODE",
"PAYPAL_CLIENT_ID",
"PAYPAL_CLIENT_SECRET",
]
for var in copy_env_vars:
locals()[var] = get_env_variable(var, default='')
Expand All @@ -93,7 +96,8 @@ def get_env_boolvar(var_name, default=NOT_SET):
'transactional': True,
}

# TODO. The ad-free payment requires something like this:
#import paypalrestsdk
#paypalrestsdk.configure(mode="sandbox", client_id="...", client_secret="...")
# The hide-the-ads payment requires Paypal integration:
if PAYPAL_CLIENT_ID:
import paypalrestsdk
paypalrestsdk.configure(mode=PAYPAL_CLIENT_MODE, client_id=PAYPAL_CLIENT_ID, client_secret=PAYPAL_CLIENT_SECRET)

0 comments on commit d97a04e

Please sign in to comment.