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

  1. Incorrect API Credentials

    • Invalid merchant_id or expired api_key

    • Test environment credentials used in production

  2. Security Protocol Mismatches

    • UCB requires TLS 1.2 or higher

    • Missing SSL certificate chain

  3. Formatting Errors

    • Amount not formatted to 2 decimal places

    • Incorrect currency code (BDT instead of “050”)

  4. Network Configuration

    • Unwhitelisted server IP

    • Firewall blocking outbound port 443

✅ How to Fix UCB Payment Gateway Integration

Step 1: Verify Merchant Configuration

php
// 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
# 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

  1. Initiate transaction with amount=100.00 (2 decimal places)

  2. Handle callback with IPN (Instant Payment Notification)

  3. 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

LEAVE A REPLY

Please enter your comment!
Please enter your name here