Skip to content
Snippets Groups Projects

Implement payment backends and interaction

Merged Nik | Klampfradler requested to merge payment-backends into master
7 files
+ 68
7
Compare changes
  • Side-by-side
  • Inline
Files
7
{% extends "core/base.html" %}
{% extends "core/base.html" %}
{% load material_form i18n %}
{% load material_form i18n rules %}
{% load render_table from django_tables2 %}
{% load render_table from django_tables2 %}
{% block browser_title %}{{ object.transaction_id }}{% endblock %}
{% block browser_title %}{{ object.number }}{% endblock %}
{% block content %}
{% block content %}
<h1>{% trans "Invoice" %} {{ object.transaction_id }} — {{ object.created.date }}</h1>
{% has_perm 'tezor.do_payment' user object as can_do_payment %}
<a class="btn colour-primary waves-effect waves-light" href="{% url 'invoice_group_by_pk' object.group.pk %}">{% trans "Back" %}</a>
{% has_perm 'tezor.view_invoice_group_rule' user object.group as can_view_invoice_group %}
 
{% has_perm 'tezor.display_purchased_items_rule' user object as can_view_purchased_items %}
 
{% has_perm 'tezor.display_billing_rule' user object as can_view_billing_information %}
 
{% has_perm 'tezor.print_invoice_rule' user object as can_print_invoice %}
{% render_table object.purchased_items_table %}
<h1>{% trans "Invoice" %} {{ object.number }} — {{ object.created.date }}</h1>
{% render_table object.totals_table %}
 
{% if can_view_invoice_group %}
 
<a class="btn colour-primary waves-effect waves-light" href="{% url 'invoice_group_by_pk' object.group.pk %}">{% trans "Back" %}</a>
 
{% endif %}
 
{% if can_print_invoice %}
 
<a class="btn colour-primary waves-effect waves-light" href="{% url 'print_invoice' object.token %}">{% trans "Print" %}</a>
 
{% endif %}
 
 
<div class="row">
 
{% if can_view_billing_information %}
 
<div class="col s12 m6">
 
<div class="card">
 
<div class="card-content">
 
<span class="card-title">{% trans "Billing information" %}</span>
 
<table class="highlight">
 
<tr>
 
<td>
 
<i class="material-icons small iconify" data-icon="mdi:account-outline"></i>
 
</td>
 
<td>{{ object.billing_first_name }} {{object.billing_last_name }}</td>
 
</tr>
 
<tr>
 
<td rowspan="2">
 
<i class="material-icons small iconify" data-icon="mdi:map-marker-outline"></i>
 
</td>
 
<td>{{ object.billing_address_1 }} {{ object.billing_address_2 }}</td>
 
</tr>
 
<tr>
 
<td>{{ object.billing_postcode }} {{ object.billing_city}}</td>
 
</tr>
 
<tr>
 
<td>
 
<i class="material-icons small iconify" data-icon="mdi:email-outline"></i>
 
</td>
 
<td>
 
<a href="mailto:{{ object.billing_email }}">{{ object.billing_email }}</a>
 
</td>
 
</tr>
 
</table>
 
</div>
 
</div>
 
</div>
 
{% endif %}
 
<div class="col s12 m6">
 
<div class="card">
 
<div class="card-content">
 
<span class="card-title">{% trans "Payment" %}</span>
 
<table class="highlight">
 
<tr>
 
<td>
 
<i class="material-icons iconify" data-icon="{{ object.get_variant_icon }}"></i>
 
</td>
 
<td>
 
{{ object.get_variant_name }}
 
</td>
 
</tr>
 
<tr>
 
<td>
 
{% if object.status == "waiting" or object.status == "input" %}
 
<i class="material-icons iconify" data-icon="mdi:cash-lock-open"></i>
 
{% elif object.status == "rejected" or object.status == "error" %}
 
<i class="material-icons iconify" data-icon="mdi:cash-remove"></i>
 
{% elif object.status == "preauth" %}
 
<i class="material-icons iconfiy" data-icon="mdi:cash-lock"></i>
 
{% elif object.status == "confirmed" %}
 
<i class="material-icons iconify" data-icon="mdi:cash-check"></i>
 
{% elif object.status == "refunded" %}
 
<i class="material-icons iconify" data-icon="mdi:cash-refund"></i>
 
{% endif %}
 
</td>
 
<td>
 
{{ object.get_status_display }}
 
</td>
 
</tr>
 
</table>
 
</div>
 
{% if object.status == "waiting" or object.status == "rejected" or object.status == "input" and can_do_payment %}
 
<div class="card-action">
 
<a class="btn waves-effect waves-light green" href="{% url 'do_payment' object.token %}">
 
<i class="material-icons left iconify" data-icon="mdi:cash-fast"></i>
 
{% trans "Pay now" %}
 
</a>
 
</div>
 
{% endif %}
 
</div>
 
</div>
 
</div>
 
 
{% if can_view_purchased_items %}
 
{% render_table object.purchased_items_table %}
 
{% render_table object.totals_table %}
 
{% endif %}
{% endblock %}
{% endblock %}
Loading