Show billing for comp'd accounts.

master
Nick Sergeant 2015-10-26 11:29:29 -04:00
parent 8a0ed4169a
commit 484892b1fe
2 changed files with 29 additions and 21 deletions

View File

@ -32,27 +32,29 @@
<div class="def" data-title="Plan"> <div class="def" data-title="Plan">
{{ name }} {{ name }}
</div> </div>
<div class="def" data-title="Price"> {% if status != 'inactive' %}
${{ amount|currency_convert }}.00 USD / {{ interval }} <div class="def" data-title="Price">
</div> ${{ amount|currency_convert }}.00 USD / {{ interval }}
<div class="def" data-title="Card"> </div>
xxxx-xxxx-xxxx-{{ last4 }} <div class="def" data-title="Card">
</div> xxxx-xxxx-xxxx-{{ last4 }}
<div class="def" data-title="Status"> </div>
{{ status }} <div class="def" data-title="Status">
</div> {{ status }}
<div class="def" data-title="Team since"> </div>
{{ team.created|date:'M d, Y' }} <div class="def" data-title="Team since">
</div> {{ team.created|date:'M d, Y' }}
<div class="def" data-title="Next bill date" ng-show="user.stripeAccount.status != 'inactive'"> </div>
{{ nextBill|to_date|date:'M d, Y' }} <div class="def" data-title="Next bill date" ng-show="user.stripeAccount.status != 'inactive'">
</div> {{ nextBill|to_date|date:'M d, Y' }}
<form class="alert alert-info group" style="margin: 15px; padding-right: 8px;" id="cancel-team-subscription" action="/{{ team.slug }}/billing/cancel/" method="post"> </div>
{% csrf_token %} <form class="alert alert-info group" style="margin: 15px; padding-right: 8px;" id="cancel-team-subscription" action="/{{ team.slug }}/billing/cancel/" method="post">
<button type="submit" class="btn btn-danger pull-right"> {% csrf_token %}
Cancel subscription <button type="submit" class="btn btn-danger pull-right">
</button> Cancel subscription
</form> </button>
</form>
{% endif %}
</section> </section>
</section> </section>
{% endblock %} {% endblock %}

View File

@ -80,6 +80,12 @@ def team_billing(request, username):
if team.owner != request.user: if team.owner != request.user:
raise Http404 raise Http404
if team.stripe_id == 'COMP':
return {
'name': 'Promotional trial',
'team': team
}
stripe.api_key = os.environ.get('STRIPE_SECRET_KEY', stripe.api_key = os.environ.get('STRIPE_SECRET_KEY',
settings.STRIPE_SECRET_KEY) settings.STRIPE_SECRET_KEY)
customer = stripe.Customer.retrieve(team.stripe_id) customer = stripe.Customer.retrieve(team.stripe_id)