{% extends 'base.html' %} {% load humanize %} {% block title %}M-Pesa Callbacks{% endblock %} {% block content %}
| Time | Type | Transaction | Who Paid | Phone | Amount | Repayment | Status | Actions |
|---|---|---|---|---|---|---|---|---|
| {{ callback.created_at|date:"Y-m-d H:i:s" }} | {% if callback.callback_type == 'validation' %} Validation {% else %} Confirmation {% endif %} |
{% if callback.transaction %}
{{ callback.transaction.trans_id|default:"N/A" }}
ID: {{ callback.transaction.bill_ref_number|default:"N/A" }} {% else %} Not linked {% endif %} |
{% if callback.transaction and callback.transaction.borrower %}
{{ callback.transaction.borrower.get_full_name|default:callback.transaction.borrower.email }}
ID: {{ callback.transaction.borrower.id_number|default:"N/A" }} {% elif callback.transaction %} โ ๏ธ Not matched {% if callback.transaction.bill_ref_number %} Bill Ref: {{ callback.transaction.bill_ref_number }} {% endif %} {% else %} - {% endif %} |
{% if callback.transaction %}
{% with phone=callback.transaction.msisdn|default:callback.transaction.phone_number %}
{% if phone %}
{% if phone|length > 17 or 'a' in phone|lower or 'b' in phone|lower or 'c' in phone|lower or 'd' in phone|lower or 'e' in phone|lower or 'f' in phone|lower %}
๐ {{ phone|truncatechars:20 }}
(Matched by ID) {% else %} {{ phone|truncatechars:15 }} {% endif %} {% else %} N/A {% endif %} {% endwith %} {% else %} - {% endif %} |
{% if callback.transaction %} KES {{ callback.transaction.amount|floatformat:2|intcomma }} {% else %} - {% endif %} |
{% if callback.transaction and callback.transaction.repayment %}
๐งพ {{ callback.transaction.repayment.receipt_number }}
Loan: {{ callback.transaction.repayment.loan.loan_number|default:"N/A" }} ๐ View in Repayments {% elif callback.transaction %} โ No Repayment {% if callback.transaction.processing_notes %} {{ callback.transaction.processing_notes|truncatewords:5 }} {% endif %} {% else %} - {% endif %} |
{% if callback.processed %}
โ Processed
{% else %}
โฐ Pending
{% endif %}
{% if callback.transaction %}
{{ callback.transaction.get_status_display }} {% endif %} |
{% if callback.transaction and not callback.transaction.repayment %} โท Retry {% endif %} |