from payments.models import MpesaConfiguration

# Check all configurations
configs = MpesaConfiguration.objects.all()
print(f"Total configurations: {configs.count()}\n")

for config in configs:
    print(f"Shortcode: {config.business_short_code}")
    print(f"Environment: {config.environment}")
    print(f"Validation URL: {config.validation_url}")
    print(f"Confirmation URL: {config.confirmation_url}")
    print(f"Active: {config.is_active}")
    print("-" * 70)

# Specifically check 4086675
print("\n" + "=" * 70)
print("Checking shortcode 4086675:")
print("=" * 70)
config_4086675 = MpesaConfiguration.objects.filter(business_short_code='4086675').first()
if config_4086675:
    print(f"Found configuration for 4086675")
    print(f"Validation URL: {config_4086675.validation_url}")
    print(f"Confirmation URL: {config_4086675.confirmation_url}")
else:
    print("No configuration found for 4086675 in database")
    print("\nNote: This doesn't mean URLs aren't registered with M-Pesa.")
    print("M-Pesa stores the URLs on their side, not in your database.")
