# UddoktaPay Transaction Verification Troubleshooting Guide

## Common Error: "Transaction verification failed. Please contact support with your transaction ID"

This error occurs when the system cannot verify a payment transaction with the UddoktaPay gateway. Here's how to troubleshoot and resolve this issue.

## Possible Causes and Solutions

### 1. Invalid or Expired Transaction ID
**Cause**: The transaction ID may be incorrect, expired, or not exist in the UddoktaPay system.

**Solution**:
- Verify that the transaction ID is correct
- Check if the payment was actually initiated
- Try making a new payment

### 2. Network or Connectivity Issues
**Cause**: Connection problems between your server and UddoktaPay API.

**Solution**:
- Check your internet connection
- Verify that your server can reach `https://api.uddoktapay.com`
- Check firewall settings

### 3. Incorrect API Configuration
**Cause**: UddoktaPay API key or base URL is incorrect.

**Solution**:
1. Go to Admin Panel → UddoktaPay Settings
2. Verify the API key is correct
3. Ensure the base URL is set to `https://api.uddoktapay.com`
4. Make sure the gateway is enabled

### 4. Sandbox vs Production Mode
**Cause**: Configuration mismatch between sandbox and production environments.

**Solution**:
- Check if you're using the correct API key for your environment
- Verify sandbox mode settings in admin panel

## Debugging Steps

### 1. Check Error Logs
Look for error messages in your PHP error log:
```bash
tail -f /var/log/apache2/error.log
# or
tail -f /var/log/nginx/error.log
```

### 2. Enable Debug Mode
Add this to your configuration to get more detailed error information:
```php
// In your PHP code
error_reporting(E_ALL);
ini_set('display_errors', 1);
ini_set('log_errors', 1);
```

### 3. Test API Connectivity
Test if your server can reach UddoktaPay:
```bash
curl -X GET https://api.uddoktapay.com/api/v1/health
```

### 4. Verify Invoice ID Format
Ensure the invoice ID follows UddoktaPay's requirements:
- Must be unique
- Should not contain special characters
- Must match the format used during payment initialization

## For Developers

### Enhanced Error Handling
The system now provides more detailed error messages including:
- Transaction ID
- Status code
- Additional error details from the gateway

### Logging
All verification attempts are logged with:
- Invoice ID
- HTTP status codes
- Response data
- Error messages

## For Users

### What to Do When You See This Error
1. Note down the Transaction ID provided in the error message
2. Check your payment method balance
3. Try the payment again
4. If the problem persists, contact support with your Transaction ID

### Contacting Support
When contacting support, provide:
- Transaction ID
- Date and time of the transaction
- Error message received
- Payment method used

## Prevention Tips

1. **Regular Configuration Checks**: Periodically verify UddoktaPay settings
2. **Network Monitoring**: Ensure stable connectivity to payment gateways
3. **Error Logging**: Maintain detailed logs for troubleshooting
4. **User Communication**: Clearly display transaction IDs for support purposes

## Common Resolution Time
Most verification issues are resolved within:
- 24 hours for network issues
- Immediately for configuration issues
- 48-72 hours for gateway-side issues

If the problem persists beyond this timeframe, contact UddoktaPay support directly.