Common UCB Payment Gateway Issues and Solutions
When integrating UCB Payment Gateway Bangladesh into your e-commerce platform, you might encounter:
-
Transaction failures (Error Code 5003)
-
SSL handshake errors
-
Timeout during payment processing
-
“Invalid merchant ID” alerts
These issues often stem from configuration mismatches in critical parameters.
🔍 Root Causes of UCB Payment Failures
-
Incorrect API Credentials
-
Invalid
merchant_idor expiredapi_key -
Test environment credentials used in production
-
-
Security Protocol Mismatches
-
UCB requires TLS 1.2 or higher
-
Missing SSL certificate chain
-
-
Formatting Errors
-
Amount not formatted to 2 decimal places
-
Incorrect currency code (BDT instead of “050”)
-
-
Network Configuration
-
Unwhitelisted server IP
-
Firewall blocking outbound port 443
-
✅ How to Fix UCB Payment Gateway Integration
Step 1: Verify Merchant Configuration
// Sample configuration for UCB PG $config = [ 'merchant_id' => 'UCB_MER_XXXXXX', // Get from UCB portal 'api_key' => 'live_...', // Never hardcode in client-side 'base_url' => 'https://pg.ucb.com.bd/api/v3/', 'timeout' => 30, // 30-second timeout ];
Step 2: Implement Proper SSL Setup
# Nginx configuration for UCB ssl_protocols TLSv1.2 TLSv1.3; ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384'; ssl_prefer_server_ciphers on;
Step 3: Validate Transaction Flow
-
Initiate transaction with
amount=100.00(2 decimal places) -
Handle callback with IPN (Instant Payment Notification)
-
Verify hash signature using UCB’s algorithm
📌 Pro Tips for UCB PG Success
-
Whitelist UCB’s IP range:
103.102.58.0/23 -
Use cURL 7.68+ for proper TLS support
-
Test with small amounts (10 BDT) before going live
-
Monitor transactions via UCB Merchant Portal


