Moneybag

WooCommerce Plugin

Official WooCommerce Payment Gateway plugin for Moneybag

WooCommerce Plugin

Official WooCommerce Payment Gateway plugin for Moneybag, enabling seamless payment integration for Bangladesh merchants through secure payment processing.


Requirements

  • WordPress 5.0 or higher
  • WooCommerce 5.0 or higher
  • PHP 7.4 or higher
  • SSL certificate (HTTPS) required for production

Installation

Method 1: WordPress Admin Dashboard

  1. Download the Plugin

    • Download the latest version from GitHub
  2. Upload and Install

    • Go to your WordPress admin dashboard
    • Navigate to Plugins → Add New → Upload Plugin
    • Choose the downloaded .zip file and click Install Now
    • Click Activate Plugin

Method 2: Manual Installation

  1. FTP Upload
    • Extract the plugin files
    • Upload the moneybag-payment-gateway folder to /wp-content/plugins/
    • Go to Plugins in your WordPress admin and activate the plugin

Configuration

1. Get Your API Credentials

  1. Log in to your Moneybag Merchant Dashboard
  2. Navigate to Settings → API Credentials
  3. Copy your Moneybag API Key

2. Configure the Plugin

  1. Access WooCommerce Settings

    • Go to WooCommerce → Settings → Payments
    • Find "Moneybag" in the payment methods list
    • Click Set up or Manage
  2. Basic Configuration

    Enable/Disable: ✓ Enable Moneybag Payment Gateway
    Title: [Checkout title for customers]
    Description: [Checkout description for customers]
  3. API Configuration

    Moneybag API Key: [Your API Key]
    Environment: Sandbox (for testing) / Production (for live)
    API Timeout: [Request timeout in seconds]
    Retry Settings: [Number of retry attempts]

3. Test Configuration

  1. Enable Sandbox Mode

    • Set Environment to "Sandbox"
    • Use your sandbox API key
  2. Place a Test Order

    • Add products to cart
    • Proceed to checkout
    • Select "Moneybag Payment Gateway"
    • Complete the payment process on Moneybag payment page
    • Verify automatic redirect back to Thank You page

Features

Core Features

  • Secure Payment Processing - Through Moneybag gateway
  • Automatic Payment Verification - Real-time payment status updates
  • WooCommerce Blocks Support - Compatible with modern checkout
  • Environment Modes - Sandbox and production support
  • Comprehensive Logging - Transaction tracking and debugging
  • Checkout Redirection - Seamless redirect to Moneybag payment page
  • Built-in Error Handling - Uses WooCommerce's logging system

Required Information

  • Billing Email - Required for payment processing
  • Phone Number - Required for customer verification
  • Automatic Status Updates - Order status updated based on payment result
  • Thank You Page Redirect - Returns to WooCommerce after payment

Webhook Configuration

1. Set Up Webhook URL

  1. Get Your Webhook URL

    https://yoursite.com/wp-json/moneybag/v1/webhook
  2. Configure in Merchant Dashboard

    • Log in to your Moneybag merchant dashboard
    • Go to Settings → Webhooks
    • Add the webhook URL
    • Select events: payment.success, payment.failed, payment.cancelled

2. Webhook Security

The plugin automatically validates webhook signatures to ensure security. No additional configuration required.


Customization

1. Payment Form Styling

Add custom CSS to your theme to style the payment form:

.moneybag-payment-form {
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 5px;
}

.moneybag-payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.moneybag-payment-method {
    text-align: center;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
}

2. Custom Order Status

// Add to your theme's functions.php
add_filter('moneybag_order_status_mapping', function($statuses) {
    $statuses['SUCCESS'] = 'processing';  // or 'completed'
    $statuses['FAILED'] = 'failed';
    $statuses['CANCELLED'] = 'cancelled';
    return $statuses;
});

3. Custom Redirect URLs

// Customize success redirect
add_filter('moneybag_success_redirect_url', function($url, $order) {
    return home_url('/custom-success-page/');
}, 10, 2);

// Customize cancel redirect
add_filter('moneybag_cancel_redirect_url', function($url, $order) {
    return wc_get_cart_url();
}, 10, 2);

Troubleshooting

Common Issues

  1. Payment Not Processing

    • Check API credentials
    • Verify SSL certificate
    • Check error logs
  2. Webhook Not Working

    • Verify webhook URL is accessible
    • Check server logs for webhook calls
    • Ensure proper SSL configuration
  3. Orders Not Updating

    • Check webhook configuration
    • Verify order status mapping
    • Review plugin logs

Enable Debug Logging

  1. Enable Logging in Plugin Settings

    • Go to WooCommerce → Settings → Payments → Moneybag
    • Check "Enable Logging"
  2. View Logs

    • Go to WooCommerce → Status → Logs
    • Select "moneybag" log files

Log Locations

/wp-content/uploads/wc-logs/moneybag-{date}.log

Hooks and Filters

Available Actions

// Before payment processing
do_action('moneybag_before_payment', $order_id, $payment_data);

// After successful payment
do_action('moneybag_payment_success', $order_id, $transaction_data);

// After failed payment
do_action('moneybag_payment_failed', $order_id, $error_data);

// Webhook received
do_action('moneybag_webhook_received', $event_type, $data);

Available Filters

// Modify payment data before sending
apply_filters('moneybag_payment_data', $data, $order);

// Modify checkout URL
apply_filters('moneybag_checkout_url', $url, $order);

// Modify payment methods display
apply_filters('moneybag_payment_methods', $methods);

// Modify order status after payment
apply_filters('moneybag_payment_order_status', $status, $payment_status);

Testing

Test Payment Methods

In sandbox mode, use these test payment details:

Test Cards:

Visa: 4111 1111 1111 1111
Mastercard: 5555 5555 5555 4444
CVV: 123
Expiry: Any future date

Mobile Banking:

  • Use any valid mobile number
  • Use OTP: 123456

Support

Documentation

Getting Help


Changelog

Version 1.2.0

  • Added refund support
  • Improved error handling
  • Enhanced security features
  • Bug fixes and performance improvements

Version 1.1.0

  • Added webhook support
  • Multi-currency support
  • Custom order status mapping
  • Improved logging

Version 1.0.0

  • Initial release
  • Basic payment processing
  • WooCommerce integration
  • Sandbox and live mode support

License

The Moneybag WooCommerce plugin is released under the MIT License.