quantum-ai-v2/test_webhook_external.py
Claude e7d5ccf017 Implement webhook-free Stripe payment verification system
 SOLUTION: Bypass webhook delivery issues entirely

Changes:
- Enhanced checkout session creation with session_id in success URL
- Updated success page to automatically verify payments via Stripe API
- Added manual payment verification modal on wallet page
- Users can verify payments manually if automatic verification fails
- Real-time balance updates without depending on webhooks

Benefits:
- Instant payment confirmation upon return from Stripe
- No webhook delivery dependency
- Manual fallback for edge cases
- Better user experience with immediate feedback

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-12 16:11:35 +05:30

62 lines
1.8 KiB
Python

#!/usr/bin/env python3
"""
Test external webhook accessibility
"""
import requests
import json
from datetime import datetime
def test_webhook_accessibility():
"""Test if Railway webhook endpoints are accessible externally"""
base_url = "https://netcop.up.railway.app"
endpoints = [
"/simple-webhook-test/",
"/stripe/webhook/",
]
print("🧪 Testing Railway webhook endpoint accessibility...")
print(f"📍 Base URL: {base_url}")
print("-" * 60)
for endpoint in endpoints:
url = base_url + endpoint
try:
print(f"\n🔍 Testing: {url}")
# Test with POST request
response = requests.post(
url,
json={
"test": True,
"source": "external_test_script",
"timestamp": datetime.now().isoformat()
},
headers={
"Content-Type": "application/json",
"User-Agent": "WebhookTester/1.0",
"X-Test-Source": "external"
},
timeout=10
)
print(f"✅ Status: {response.status_code}")
print(f"✅ Response: {response.text[:200]}")
if response.status_code < 400:
print(f"✅ SUCCESS: {endpoint} is accessible")
else:
print(f"❌ FAILED: {endpoint} returned {response.status_code}")
except requests.exceptions.RequestException as e:
print(f"❌ CONNECTION ERROR: {e}")
except Exception as e:
print(f"❌ UNEXPECTED ERROR: {e}")
print("\n" + "=" * 60)
print("🏁 External accessibility test completed")
if __name__ == "__main__":
test_webhook_accessibility()