diff --git a/www/~/%username/identities/index.spt b/www/~/%username/identities/index.spt new file mode 100644 index 0000000000..61e43ed25f --- /dev/null +++ b/www/~/%username/identities/index.spt @@ -0,0 +1,20 @@ +from gratipay.utils import get_participant +[---] +request.allow('GET', 'POST') +participant = get_participant(state, restrict=False) +title = _("Identities") +[---] text/html +{% extends "templates/profile.html" %} +{% block content %} +{% for identity in participant.list_identity_metadata() %} +

{{ locale.countries[identity.country.code2] }}{% if identity.is_verified %} ✓{% endif %}

+ {{ _('verified in: {country}', country=locale.countries[identity.country.code2]) }} +{% endfor %} + +
+ + +{% endblock %} diff --git a/www/~/%username/identity.spt b/www/~/%username/identity.spt deleted file mode 100644 index ee7898b11c..0000000000 --- a/www/~/%username/identity.spt +++ /dev/null @@ -1,151 +0,0 @@ -import balanced - -from gratipay.billing.exchanges import repr_exception -from gratipay.utils import get_participant - -[---] -request.allow('GET', 'POST') -participant = get_participant(state, restrict=True) -title = _("Identity Verification") -error = '' - -if request.method == 'POST': - account = participant.get_balanced_account() - - body = request.body - account.name = body.get('name') - account.address['line1'] = body.get('address_1') - account.address['line2'] = body.get('address_2') - account.address['postal_code'] = body.get('postal_code') - account.address['city'] = body.get('city') - account.address['state'] = body.get('region') - account.address['country_code'] = body.get('country') - account.phone = body.get('phone_number') - account.ssn_last4 = body.get('ssn_last4') or None - - dob = body.get('dob', '') - if dob: - try: - account.dob_year, account.dob_month, account.meta['dob_day'] = \ - map(int, dob.split('-')) - except ValueError: - error = _("Invalid date of birth.") - - if not error: - # This will possibly fail with 400 if formatted badly, or 300 if we - # cannot identify the merchant. - try: - account.save() - except balanced.exc.HTTPError as err: - error = repr_exception(err) - else: - if account.merchant_status != 'underwritten': - error = _("Unable to verify your identity") - -elif participant.balanced_customer_href: - account = participant.get_balanced_account() - -else: - account = balanced.Customer(address={}, meta={}) - -[---] text/html -{% extends "templates/profile.html" %} - -{% block scripts %} - {{ super() }} - -{% endblock %} - -{% block content %} - -{% if account.merchant_status == 'underwritten' %} -

{{ _( "Your identity is verified, which means you may add a {0}bank account{1}." - , ''|safe - , ''|safe) }}

-{% endif %} - -
-
- - - - - -
- - - - - - - - - - - -
- - - - - - - -
- - - -
-
- - - -
-
- -{% endblock %}