Skip to content

MoneyUnify - A Simplified USSD Mobile Money Payments API that allows you to collect and disburse money from and to your customers using various mobile money network providers, in one place. Used in Africa and around the world for online Payments. Supports MTN Mobile Money, AirtelMobile Money, and Zamtel Mobile Money.

License

Notifications You must be signed in to change notification settings

blessedjasonmwanza/MoneyUnify

Repository files navigation

MoneyUnify Payments API Library Documentation

The MoneyUnify Payments API library provides an easy interface for integrating with the MoneyUnify API to process mobile money payments. This documentation will guide you through the installation process and demonstrate how to use the library effectively. Support for multiple programming languages is available here.

  • MoneyUnify - Payments in Zambia (Recommended for businesses/individuals in Zambia)

    Instant settlements and repayments

    image

    Ideal for money collections in Zambia - Coming soon to Tanzania, Nigeria, Kenya 👀

    • Make Collections - Request mobile Money payments from AIRTEL, MTN, & ZAMTEL (All Network operators in Zambia)
    • Settle Funds - Disburse and settle funds from your MoneyUnify Account to MTN, Zamtel, MTN All Mobile Networks Instantly
    • 🤙 Instant Customer support available via - 📞 WhatsApp

    SETUP

    Supported Countries on the MoneyUnify Endpoint

    Country Country Code Currency Currency Code Status
    ZAMBIA ZM Zambian Kwacha ZMW Active ✔️
    TANZANIA TZ Tanzanian Shilling TZS Coming Soon ⏰
    KENYA KE Kenyan Shilling KES Coming Soon ⏰

Table of Contents

  1. Charges and Fees
  2. Installation
  3. Usage
  4. Conclusion
  5. Author
  6. 🤝 Contributing
  7. Show your Support

Charges and Fees


Collections (Receiving Payments)

2.5% + 1 ZMW per transaction (reduced from the initial 3.5%)

Settlements / Transferring to Mobile Money
Settlement Account Balance What You'll Receive Charges/Transaction Fees
Balance [20 ZMW ~ 1,000 ZMW] Balance - 12 12 ZMW
Balance [1,000 ZMW ~ 50,000 ZMW] Balance - 20 20 ZMW
Balance [50,000 ~ 100,000 ZMW] Balance - 30 30 ZMW

Installation

Documentation usage for languages other than PHP is available here.

  1. Install Composer (if you haven’t already). Follow the Composer installation guide.

  2. Install the MoneyUnify Library by adding it to your composer.json:

    composer require blessedjasonmwanza/moneyunify

Usage

Basic Usage

  1. Include the Autoload File:

    require 'vendor/autoload.php'; // Include Composer autoload
  2. Create an Instance of the MoneyUnify Class:

    use Blessedjasonmwanza\MoneyUnify\MoneyUnify;
    
    $muid = 'your_unique_muid'; // Replace with your actual MUID - obtain it at https://MoneyUnify.com
    $moneyUnify = new MoneyUnify($muid);
  3. Call the requestPayment Method:

    $payerPhoneNumber = '0xxxxxxxx'; // Replace with payer's phone number
    $amountToPay = '10'; // Amount to be paid
    
    $response = $moneyUnify->requestPayment($payerPhoneNumber, $amountToPay);
  4. Check the Response:

    if ($response->isError) {
        echo "Error: " . $response->message . "\n";
        echo "Console: " . ($response->console ?? 'No console message to debug') . "\n";
    } else {
        echo "Success: " . $response->message . "\n";
        echo "Data: " . json_encode($response->data) . "\n";
    }

Example Successful Response

{
  "message": "Transaction successful",
  "data": {
    "amount": "5.00",
    "customer_name": "Blessed Mwanza",
    "customerMobileWallet": "0769641179",
    "reference": "0762611179_1713450343",
    "status": "successful"
  },
  "isError": false
}

Verifying a Payment

To verify a payment, use the verifyPayment method:

  1. Verify the Payment:

    $transactionReference = 'your_transaction_reference'; // Replace with transaction reference
    $verificationResponse = $moneyUnify->verifyPayment($transactionReference);
  2. Check the Verification Response:

    if ($verificationResponse->isError) {
        echo "Error: " . $verificationResponse->message . "\n";
        echo "Console: " . ($verificationResponse->console ?? 'No console message to debug') . "\n";
    } else {
        echo "Verification Success: " . $verificationResponse->message . "\n";
        echo "Data: " . json_encode($verificationResponse->data) . "\n";
    }

Example Verification Response

{
  "message": "Transaction pending OTP confirmation",
  "data": {
    "amount": "1.00",
    "customer_name": "Dilip Okafor",
    "customerMobileWallet": "260975555555",
    "reference": "0975555555_1713447717",
    "status": "otp-required"
  },
  "isError": false
}

Settling Funds

To settle the current virtual account balance, use the settleFunds method:

  1. Settle Funds:

    $settleParams = [
        'moneyunify_email' => '[email protected]', // Replace with your MoneyUnify email
        'receiver_first_name' => 'Blessed',
        'receiver_last_name' => 'Mwanza',
        'receiver_phone_number' => '0971943638', // Replace with receiver's phone number
        'transaction_details' => 'Settling funds to the specified account.'
    ];
    
    $settlementResponse = $moneyUnify->settleFunds($settleParams);
  2. Check the Settlement Response:

    if ($settlementResponse->isError) {
        echo "Error: " . $settlementResponse->message . "\n";
        echo "Console: " . ($settlementResponse->console ?? 'No console message to debug') . "\n";
    } else {
        echo "Settlement Success: " . $settlementResponse->message . "\n";
        echo "Data: " . json_encode($settlementResponse->data) . "\n";
    }

Example Successful Settlement Response

{
  "message": "Transaction successful",
  "data": {
    "amount": "9.29",
    "customer_name": "BLESSED MWANZA",
    "customerMobileWallet": "0971943638",
    "reference": "Settlement_0971943638_1713460876",
    "status": "successful"
  },
  "isError": false
}

Conclusion

The MoneyUnify library simplifies the process of integrating with the Money Unify API. By following the steps outlined in this documentation, you can easily set up and make payment requests, verify transactions, and settle funds. For further assistance, feel free to reach out or check the official documentation for more advanced features.


Author

Author

👤 Blessed Jason Mwanza - show support 💖🙌 Buy him a Coffee

🤝 Contributing

Feel free to contribute to this project by submitting a pull request. Your contributions help improve the library and enhance the experience for all users!

Feature requests are welcome! Check the issues page or request a feature by creating a new issue.

Show your Support

If you find this library helpful, consider supporting it by sharing it with others or donating. Your support is greatly appreciated!

About

MoneyUnify - A Simplified USSD Mobile Money Payments API that allows you to collect and disburse money from and to your customers using various mobile money network providers, in one place. Used in Africa and around the world for online Payments. Supports MTN Mobile Money, AirtelMobile Money, and Zamtel Mobile Money.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages