Plugins & Libraries

Official integration libraries and plugins to easily integrate MarzPay into your applications and platforms

Production Ready

WordPress Plugin

Accept mobile money payments in WordPress using the MarzPay Collections API. Perfect for businesses in Uganda accepting mobile payments.

Version: 1.0.0 WordPress: 5.0+ PHP: 7.4+
  • • Payment button shortcodes [marzpay_button]
  • • Admin settings panel with API testing
  • • Phone & amount validation (500-10M UGX)
  • • Automatic UUID generation & callbacks
  • • Built-in debugging & troubleshooting tools
  • • Professional documentation & support
  • • WordPress.org ready with GPL v2 license

Quick Start: [marzpay_button amount="1000" phone="256759983853"]

Production Ready

JavaScript/Node.js

Integrate MarzPay into web applications and Node.js backends with our comprehensive JavaScript library.

Version: 1.0.0 Node.js: 14+ Browser: ES6+
  • • Collections & Disbursements API
  • • TypeScript support with full type definitions
  • • Browser and Node.js compatibility
  • • Phone number validation & formatting
  • • Comprehensive error handling
  • • Multiple build formats (UMD, CommonJS, ES Modules)

Quick Start: npm install marzpay-js

Production Ready

Python SDK

Official Python SDK for MarzPay with complete API coverage, error handling, and webhook support.

Version: 1.0.0 Python: 3.8+ PyPI: Available
  • • Complete API Coverage (Collections, Disbursements, Accounts, Balance, Transactions, Services, Webhooks, Phone Verification)
  • • Comprehensive error handling with custom exception classes
  • • Phone number utilities and validation
  • • Webhook support and validation
  • • Full test coverage with pytest
  • • Professional grade production-ready SDK

Quick Start: pip install marzpay-python

Available

PHP Library

Official PHP SDK for MarzPay with Laravel integration, collections, disbursements, and phone verification.

Version: 1.0.0 PHP: 8.0+ Composer: Available
  • • Collections & Disbursements API
  • • Laravel ServiceProvider & Facade
  • • Phone Verification
  • • Auto UUID generation
  • • Comprehensive error handling
  • • Full test coverage

Install: composer require marzpay/php-sdk

Coming Soon

Go Library

Go integration for high-performance applications with middleware support.

Version: 0.1.0 (Beta) Go: 1.19+ Modules: Go modules
  • • High performance
  • • Context support
  • • Middleware support
  • • Comprehensive testing
  • • CLI tool

Quick Start: go get github.com/marzpay/collections-go

Coming Soon View API Docs
Coming Soon

Mobile SDKs

Native mobile app integration for iOS, Android, React Native, and Flutter.

Status: Coming Soon Platforms: iOS, Android, React Native, Flutter
  • • Native performance
  • • Offline support
  • • Push notifications
  • • Biometric authentication
  • • Deep linking

Platforms: iOS, Android, React Native, Flutter

Coming Soon View API Docs

MarzPay Collections WordPress Plugin

Accept mobile money payments in WordPress using the MarzPay Collections API. Perfect for businesses in Uganda accepting mobile payments.

Overview

The MarzPay Collections WordPress Plugin provides seamless integration between WordPress websites and the MarzPay Collections API. This plugin enables businesses in Uganda to accept mobile money payments directly through their WordPress site using simple shortcodes.

What is MarzPay?

MarzPay is a mobile money payment platform that allows businesses to collect payments from customers via mobile money in Uganda. The platform supports multiple mobile money providers and offers a secure, reliable payment collection service.

Plugin Benefits

  • Easy Integration: Simple shortcode system for payment buttons
  • Secure Payments: Professional-grade security and validation
  • Flexible Configuration: Customizable settings and callback URLs
  • Mobile Optimized: Works perfectly on all devices
  • Professional Support: Built-in testing and debugging tools

Features

Core Features

  • Payment Button Shortcodes - Easy to use [marzpay_button]
  • Admin Settings Panel - Professional configuration interface
  • API Integration - Full MarzPay Collections API support
  • Phone Number Support - Multiple format validation
  • Amount Validation - Built-in limits (500 - 10,000,000 UGX)
  • UUID Generation - Secure reference creation
  • Callback Support - Configurable webhook URLs

Security Features

  • Input Validation - All inputs sanitized and validated
  • Nonce Verification - CSRF protection for forms
  • Capability Checks - Admin-only access
  • Error Handling - Secure error messages
  • API Authentication - Basic auth with credentials

User Experience

  • Professional Interface - Clean, organized admin panel
  • API Testing Tools - Built-in connection testing
  • Debug Shortcode - Troubleshooting for admins
  • Error Notifications - Clear success/failure messages
  • Helpful Descriptions - Guidance for all settings

Requirements

WordPress Requirements

  • WordPress Version: 5.0 or higher
  • PHP Version: 7.4 or higher
  • MySQL Version: 5.6 or higher

Server Requirements

  • HTTPS Support: Required for secure API communication
  • cURL Extension: For API requests
  • JSON Extension: For data processing
  • Memory Limit: Minimum 64MB recommended

MarzPay Requirements

  • API Account: Active MarzPay Collections API account
  • API Credentials: Valid API User and API Key
  • Business Verification: Verified business account with MarzPay

Installation

Method 1: WordPress Admin (Recommended)

Download Plugin
Install in WordPress
  • • Go to WordPress Admin → Plugins → Add New
  • • Click "Upload Plugin"
  • • Choose the ZIP file and click "Install Now"
  • • Click "Activate Plugin"

Method 2: Manual Installation

Extract Files
  • • Extract the downloaded ZIP file
  • • Upload the marzpay-collections folder to /wp-content/plugins/
Activate Plugin
  • • Go to WordPress Admin → Plugins
  • • Find "MarzPay Collections" and click "Activate"

Method 3: Git Clone

cd /wp-content/plugins/
git clone https://github.com/Katznicho/marzpaywordpressplugin.git marzpay-collections

Configuration

Step 1: Access Settings

Go to WordPress Admin → Settings → MarzPay. You'll see the configuration panel.

Step 2: Enter API Credentials

  • API User: Your MarzPay API username
  • API Key: Your MarzPay API key
  • Callback URL: (Optional) Custom webhook URL

Step 3: Test Connection

  • • Click "Test API Connection"
  • • Enter a test phone number
  • • Verify the connection works

Step 4: Save Settings

Click "Save Settings" to store your configuration.

Usage

Basic Payment Button

[marzpay_button amount="1000" phone="256759983853"]

Shortcode Parameters

Parameter Required Description Example
amount Yes Payment amount in UGX (500-10,000,000) 1000
phone Yes Customer phone number 256759983853

Phone Number Formats

The plugin automatically converts phone numbers to the required format:

Input Format Converts To Description
256759983853 +256759983853 Recommended - Full country code
0759983853 +256759983853 Local format - automatically prefixed
+256759983853 +256759983853 International format - used as-is

Amount Requirements

  • Minimum: 500 UGX
  • Maximum: 10,000,000 UGX
  • Format: Whole numbers only
  • Currency: Ugandan Shillings (UGX)

Usage Examples

Simple Payment Button
[marzpay_button amount="5000" phone="256759983853"]
Multiple Payment Options
<h3>Choose Payment Amount:</h3>
<p>Small Donation: [marzpay_button amount="1000" phone="256759983853"]</p>
<p>Medium Donation: [marzpay_button amount="5000" phone="256759983853"]</p>
<p>Large Donation: [marzpay_button amount="10000" phone="256759983853"]</p>
Dynamic Amounts (PHP)
<?php
$amount = 2500; // Get from form or calculation
$phone = "256759983853"; // Get from user input
echo do_shortcode("[marzpay_button amount='{$amount}' phone='{$phone}']");
?>

API Reference

MarzPay Collections API Endpoint

POST https://wallet.wearemarz.com/api/v1/collect-money

Authentication

Basic Authentication using your API credentials:

Authorization: Basic {base64_encode(API_USER:API_KEY)}

Request Body Format

{
  "amount": 500,
  "phone_number": "+256759983853",
  "reference": "uuid-v4-format",
  "description": "Payment description",
  "callback_url": "https://yoursite.com/marzpay-callback",
  "country": "UG"
}

Request Parameters

Parameter Type Required Description Example
amount Integer Yes Amount in UGX (500-10,000,000) 500
phone_number String Yes Phone in +256XXXXXXXXX format +256759983853
reference String Yes Unique UUID v4 reference uuid-here
description String Yes Payment description Payment description
callback_url String Yes Webhook notification URL https://yoursite.com/callback
country String Yes Country code (UG for Uganda) UG

Response Format

Success Response
{
  "status": "success",
  "message": "Payment request sent successfully",
  "data": {
    "reference": "uuid-here",
    "amount": 500,
    "phone_number": "+256759983853"
  }
}
Error Response
{
  "status": "error",
  "message": "Error description",
  "error_code": "ERROR_CODE"
}

Error Codes

Code Description Solution
VALIDATION_ERROR Input validation failed Check amount, phone, and reference format
INVALID_CREDENTIALS API credentials invalid Verify API User and Key
MINIMUM_AMOUNT Amount below 500 UGX Increase amount to minimum
MAXIMUM_AMOUNT Amount above 10,000,000 UGX Decrease amount to maximum
INVALID_PHONE Phone number format invalid Use supported phone formats

Security

Input Validation

  • Amount: Numeric validation with min/max limits
  • Phone: Regex validation for proper format
  • Reference: UUID v4 format validation
  • Sanitization: All inputs cleaned and sanitized

Form Security

  • Nonce Verification: CSRF protection for all forms
  • Capability Checks: Admin-only access to settings
  • Input Sanitization: XSS protection
  • Error Handling: Secure error messages

API Security

  • Basic Authentication: Secure credential transmission
  • HTTPS Required: All API calls use secure connections
  • Input Validation: Server-side validation before API calls
  • Error Logging: Secure logging without sensitive data exposure

Troubleshooting

Common Issues

1. "Invalid API response" Error

Cause: API connection or authentication issue

Solution: Check API credentials and test connection

2. "URI too large" Error

Cause: Error message too long for URL

Solution: Use the "View Detailed Error Information" section

3. "422 Validation Error"

Cause: Invalid request format or data

Solution: Check amount limits and phone number format

4. "Reference must be a valid UUID"

Cause: Reference format issue

Solution: Plugin automatically generates valid UUIDs

5. "Minimum amount for collection is 500 UGX"

Cause: Amount below MarzPay minimum

Solution: Use amounts 500 UGX or higher

Debug Tools

Debug Shortcode
[marzpay_debug]

Shows API credentials status and WP_DEBUG information.

API Test Button
  • • Go to Settings → MarzPay
  • • Click "Test API Connection"
  • • Enter test phone number
  • • View detailed results
Error Logs

Enable WordPress debugging:

// In wp-config.php
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);

Getting Help

  • Check Error Messages: Use the detailed error information
  • Test API Connection: Verify credentials work
  • Review Settings: Ensure all fields are filled
  • Check Logs: Enable WordPress debugging
  • Contact Support: Reach out to MarzPay support

Ready to Get Started?

Download the plugin and start accepting mobile money payments in WordPress today!

Need Help Getting Started?

Our API documentation provides comprehensive guides, examples, and references for payments, collections, webhooks, and more.