import traceback from datetime import datetime, timedelta import balanced from aspen import json, log, Response from gittip import billing, MONTHS from gittip.elsewhere import github # ========================================================================== ^L balanced_account_uri = None account = None bank_account = None status = ". . ." if not user.ANON: balanced_account_uri = user.balanced_account_uri status = "not connected" if balanced_account_uri: working = user.last_ach_result == "" status = "connected" if working else "not connected" account = balanced.Account.find(balanced_account_uri) bank_account = billing.BalancedBankAccount(balanced_account_uri) if bank_account.is_setup: # Factored out to aid debugging. This extra var will show up in the # context on Sentry so we can compare the two values. See: # # https://github.com/gittip/www.gittip.com/issues/791 _bank_account_account_uri = bank_account['account_uri'] assert balanced_account_uri == _bank_account_account_uri username = user.username title = "Bank Account" # ========================================================================== ^L {% extends templates/base.html %} {% block heading %}

Your bank account is {{ status }}

When you receive money on Gittip we {% if bank_account and bank_account.is_setup %}will{% else %}can{% end %} automatically deposit it into your bank account. If you don't connect a bank account then your money will accumulate within Gittip unless you regift it to others.

{% end %} {% block box %} {% if user.ANON %}

Sign in using Twitter or GitHub, and then you'll be able to add or change your bank account.

Thanks! :-)

{% else %}
{% if bank_account and bank_account.is_setup %}

Current: {{ bank_account['bank_name'] }} ******{{ bank_account['last_four'] }}

{% end %}
{% if user.last_ach_result %}

Failure

{{ user.last_ach_result }}

{% end %}
{% if account and 'merchant' in account.roles %}

Identity Verification  

Routing Information

{% end %} {% if not account or 'merchant' not in account.roles %}

Identity Verification

Routing Information

{% end %}
{% if bank_account and bank_account.is_setup %} {% end %}
{% end %} {% end %} {% block page %} {% end %}