Created
August 24, 2012 01:10
-
-
Save chadwhitacre/3444317 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Used when a person needed to go to Balanced to verify their merchant details | |
they are redirected here after the fact. | |
""" | |
from aspen import Response | |
from gittip import billing | |
#=========================================================================== ^L | |
if user.ANON: | |
raise Response(404) | |
request.allow('GET') | |
# no validation here, if any of this stuff errors out, it's because someone has | |
# done something dodgy (or we f'd up) | |
assert user.balanced_account_uri is not None, user.id | |
account = billing.get_balanced_account(user.id, user.balanced_account_uri) | |
merchant_uri = qs['merchant_uri'] | |
account.add_merchant(merchant_uri) | |
bank_account = account.bank_accounts.all()[-1] | |
billing.associate(u"bank account", user.id, account, bank_account.uri) | |
request.redirect('/bank-account.html') | |
#=========================================================================== ^L |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment