{% extends 'base.html' %} {% block title %}Test M-Pesa Payment{% endblock %} {% block content %}

Test M-Pesa Payment

Back to Dashboard
Simulate Payment
{% if config.environment != 'sandbox' %}
⚠️ Payment simulation is only available in sandbox environment.
{% else %}
{% csrf_token %}
{{ form.phone_number }} {% if form.phone_number.help_text %} {{ form.phone_number.help_text }} {% endif %} {% if form.phone_number.errors %}
{{ form.phone_number.errors.0 }}
{% endif %}
{{ form.amount }} {% if form.amount.help_text %} {{ form.amount.help_text }} {% endif %} {% if form.amount.errors %}
{{ form.amount.errors.0 }}
{% endif %}
{{ form.bill_ref_number }} {% if form.bill_ref_number.help_text %} {{ form.bill_ref_number.help_text }} {% endif %} {% if form.bill_ref_number.errors %}
{{ form.bill_ref_number.errors.0 }}
{% endif %}
{% endif %}
Testing Instructions
ℹ️ How to Test
  1. Make sure you have a borrower registered with the phone number
  2. Ensure the borrower has an active loan
  3. Enter the phone number and amount
  4. Optionally specify a loan number in the reference field
  5. Click "Simulate Payment" to trigger the M-Pesa flow
⚠️ Test Phone Numbers

Use these test numbers in sandbox:

  • 254708374149
  • 254711XXXXXX
  • 254733XXXXXX
{% if config %}
⚙️ Current Configuration

Environment: {{ config.get_environment_display }}

Short Code: {{ config.business_short_code }}

Status: {% if config.is_active %} Active {% else %} Inactive {% endif %}

{% endif %}
{% endblock %}