{% extends 'base.html' %} {% load humanize %} {% block title %}Transaction Details - {{ transaction.trans_id }}{% endblock %} {% block content %}

Transaction Details

โ† Back to Transactions {% if transaction.status != 'processed' and transaction.status != 'confirmed' %} โ†ท Reprocess {% endif %}
Transaction Information
{% if transaction.third_party_trans_id %} {% endif %} {% if transaction.org_account_balance %} {% endif %}
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 }}
Customer & Loan Information
{% if transaction.payment_source %} {% endif %}
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 %}
{% if transaction.processing_notes %}
Processing Notes
{{ transaction.processing_notes }}
{% endif %} {% if callbacks %}
Related Callbacks {{ callbacks.count }}
{% for callback in callbacks %} {% endfor %}
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 %}
{% endif %}
Raw Data
{% if transaction.raw_validation_data %}
Validation Data:
{{ transaction.raw_validation_data|pprint }}
{% endif %} {% if transaction.raw_confirmation_data %}
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 %}
{% endblock %}