{% extends 'base.html' %} {% load humanize %} {% block title %}Transaction Details - {{ transaction.trans_id }}{% endblock %} {% block content %}
| Transaction ID: |
{{ transaction.trans_id|default:"N/A" }}
{% if transaction.mpesa_transaction_id %}
{{ transaction.mpesa_transaction_id }} {% endif %} |
|---|---|
| Status: | {% if transaction.status == 'confirmed' or transaction.status == 'processed' %} {{ transaction.get_status_display }} {% elif transaction.status == 'pending' or transaction.status == 'validated' %} {{ transaction.get_status_display }} {% else %} {{ transaction.get_status_display }} {% endif %} |
| Amount: | KES {{ transaction.amount|floatformat:2|intcomma }} |
| Transaction Type: | {{ transaction.transaction_type|default:"N/A" }} |
| Transaction Time: | {{ transaction.trans_time|default:"N/A" }} |
| Created: | {{ transaction.created_at|date:"Y-m-d H:i:s" }} |
| Business Short Code: | {{ transaction.business_short_code|default:"N/A" }} |
| Bill Reference: | {{ transaction.bill_ref_number|default:"N/A" }} |
| Invoice Number: | {{ transaction.invoice_number|default:"N/A" }} |
| Third Party Trans ID: | {{ transaction.third_party_trans_id }} |
| Org Account Balance: | KES {{ transaction.org_account_balance|floatformat:2|intcomma }} |
| Phone Number: | {{ transaction.phone_number|default:transaction.msisdn|default:"N/A" }} |
|---|---|
| Customer Name: | {% if transaction.first_name %} {{ transaction.first_name }} {{ transaction.middle_name|default:"" }} {{ transaction.last_name|default:"" }} {% else %} N/A {% endif %} |
| Borrower: |
{% if transaction.borrower %}
{{ transaction.borrower.get_full_name }}
ID: {{ transaction.borrower.id_number|default:"N/A" }} | Phone: {{ transaction.borrower.phone_number|default:"N/A" }} {% else %} โ ๏ธ Not matched {% if transaction.bill_ref_number %} Bill Ref: {{ transaction.bill_ref_number }} {% endif %} {% endif %} |
| Loan: |
{% if transaction.loan %}
{{ transaction.loan.loan_number }}
Outstanding: KES {{ transaction.loan.outstanding_amount|floatformat:2|intcomma }} {% else %} Not matched {% endif %} |
| Repayment: |
{% if transaction.repayment %}
๐งพ {{ transaction.repayment.receipt_number }}
Amount: KES {{ transaction.repayment.amount|floatformat:2|intcomma }} | Date: {{ transaction.repayment.payment_date|date:"Y-m-d H:i:s" }} View Loan ๐ All Repayments {% else %} โ No repayment created {% if transaction.processing_notes %} {{ transaction.processing_notes }} {% endif %} {% endif %} |
| Payment Source: | {{ transaction.payment_source }} |
| Automatic: | {% if transaction.is_automatic %} โ Yes {% else %} โ No {% endif %} |
| Time | Type | IP Address | Processed | Response | Actions |
|---|---|---|---|---|---|
| {{ callback.created_at|date:"Y-m-d H:i:s" }} | {% if callback.callback_type == 'validation' %} Validation {% else %} Confirmation {% endif %} | {{ callback.ip_address|default:"N/A" }} | {% if callback.processed %} Yes {% else %} Pending {% endif %} | {% if callback.response_sent %} Code: {{ callback.response_sent.ResultCode|default:"N/A" }} {% else %} - {% endif %} |
{{ transaction.raw_validation_data|pprint }}
{% endif %}
{% if transaction.raw_confirmation_data %}
{{ transaction.raw_confirmation_data|pprint }}
{% endif %}
{% if not transaction.raw_validation_data and not transaction.raw_confirmation_data %}
No raw data available
{% endif %}