{% extends "base.html" %} {% block title %}Payment Investigation #{{ payment.id }} - Admin Dashboard - {{ project_name }}{% endblock %} {% block content %}

Payment Investigation

Detailed payment analysis and support tools

{% if warnings %}

Investigation Warnings

{% for warning in warnings %}
{{ warning }}
{% endfor %}
{% endif %}

Payment #{{ payment.id }}

{{ payment.get_status_display }}
User {{ payment.user.email }}
Payment Type {{ payment.get_payment_type_display }}
Amount ${{ payment.amount }} {{ payment.currency|upper }}
Created {{ payment.created_at|date:"M d, Y H:i:s" }}
Updated {{ payment.updated_at|date:"M d, Y H:i:s" }}
Description {{ payment.description|default:"—" }}
Stripe Payment Intent {% if payment.stripe_payment_intent_id %} {{ payment.stripe_payment_intent_id }} {% else %} None {% endif %}
Stripe Subscription {% if payment.stripe_subscription_id %} {{ payment.stripe_subscription_id }} {% else %} None {% endif %}
Stripe Invoice {% if payment.stripe_invoice_id %} {{ payment.stripe_invoice_id }} {% else %} None {% endif %}
Receipt Number {% if payment.receipt_number %} {{ payment.receipt_number }} {% else %} None {% endif %}
{% if payment.status == 'succeeded' and payment.payment_type != 'REFUND' %} {% endif %}
{% if payment.receipt_number %} Download Receipt {% endif %}
{% if stripe_data %}

Stripe Payment Intent Data

Stripe ID {{ stripe_data.id }}
Amount ${{ stripe_data.amount|floatformat:2 }} {{ stripe_data.currency|upper }}
Status {{ stripe_data.status|title }}
Payment Method {{ stripe_data.payment_method_types.0|default:"Unknown"|title }}
Customer {% if stripe_data.customer %} {{ stripe_data.customer }} {% else %} None {% endif %}
Created {{ stripe_data.created|date:"M d, Y H:i:s" }}
Confirmation Method {{ stripe_data.confirmation_method|default:"automatic"|title }}
Client Secret {% if stripe_data.client_secret %} {{ stripe_data.client_secret|slice:":20" }}... {% else %} None {% endif %}
{% elif stripe_enabled and payment.stripe_payment_intent_id %}
Could not retrieve Stripe payment intent data. Check Stripe configuration or payment intent status.
{% endif %} {% if related_transactions %}

Related Credit Transactions

{% for transaction in related_transactions %} {% endfor %}
Date Amount Type Description Expiration
{{ transaction.created_at|date:"M d, Y H:i" }} {{ transaction.amount }} credits {{ transaction.get_credit_type_display }} {{ transaction.description }} {% if transaction.expiration_date %} {{ transaction.expiration_date|date:"M d, Y" }} {% else %} Never {% endif %}
{% endif %} {% if refund_history %}

Refund History

{% for refund in refund_history %} {% endfor %}
Date Amount Status Description
{{ refund.created_at|date:"M d, Y H:i" }} ${{ refund.amount|floatformat:2 }} {{ refund.currency|upper }} {{ refund.get_status_display }} {{ refund.description }}
{% endif %} {% if user_payment_history %}

Recent User Payment History

Last 10 payments for {{ payment.user.email }}

{% for user_payment in user_payment_history %} {% endfor %}
Date Type Amount Status Description Actions
{{ user_payment.created_at|date:"M d, Y H:i" }} {{ user_payment.get_payment_type_display }} ${{ user_payment.amount }} {{ user_payment.currency|upper }} {{ user_payment.get_status_display }} {% if user_payment.description|length > 30 %} {{ user_payment.description|slice:":30" }}... {% else %} {{ user_payment.description|default:"—" }} {% endif %} {% if user_payment.id != payment.id %} {% else %} Current {% endif %}
{% endif %}
{% endblock %}