MENU Navbar
javascript php python
  • Welcome
  • General First Steps
  • Usage
  • Welcome

    Mazzuma provides easy to use interfaces for connecting your web application or mobile application to the service. This allow you to gain mobile money payments from customers and clients with optimal ease and at no extra charges (standard mobile money operator charges apply).

    General First Steps

    In order to start using Mazzuma to receive payments, you would have to register to use the service. Head over to the dashboard and create a new Mazzuma account. You would enter the mobile money account you would wish payments to be made to during the registration process. Once registered, log into your account. You would have an API key generated, which you can view in the API section. This API Key should be noted, as it would authorise payments to your account, as well as direct incoming funds to your mobile money account.

    Usage

    Websites and Applications

    Sample Payload

    {
      "price": 1,
      "network": "mtn",
      "recipient_number": "026xxxxxxx",
      "sender": "024xxxxxxx",
      "option": "rmta",
      "apikey": ""
    }
    

    Sample Request

      var xhr = new XMLHttpRequest();
      xhr.open("POST", 'https://client.teamcyst.com/api_call.php', true);
    
      //Send the proper header information along with the request
      xhr.setRequestHeader("Content-type", "application/json");
    
      xhr.onreadystatechange = function() {
        //Call a function when the state changes.
          if(xhr.readyState == XMLHttpRequest.DONE && xhr.status == 200) {
              // Request finished. Do processing here.
          }
      }
      //Replace requestPayload with the payload you would be sending
      xhr.send(requestPayload); 
    
    <?php
    $url = 'https://client.teamcyst.com/api_call.php';
    
    
    $additional_headers = array(
       'Content-Type: application/json'
    );
    
    $ch = curl_init($url);                                                                      
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                     
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data); // $data is the request payload                                                                  
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                                                                      
    curl_setopt($ch, CURLOPT_HTTPHEADER, $additional_headers); 
    
    $server_output = curl_exec ($ch);
    ?>
    
    # Note this sample is functional for python 3 only. 
    # It also makes use of the requests library, available at python-requests.org
    
    import requests 
    
    url= 'https://client.teamcyst.com/api_call.php'
    payload =  # the payload object for the request
    response = requests.post(url, data=payload)
    

    Making a payment request

    ENDPOINT

    https://client.teamcyst.com/api_call.php

    CONTENT TYPE

    application/json

    REQUEST TYPE

    POST

    PAYLOAD

    Key Description
    price The amount to be paid
    network This is the network of the mobile money account that would be making the payment (your customer).
    recipient_number This is the mobile money account the payments shall end up in. (your account).
    sender This is the mobile money account that would be making the payment (your customers).
    option This denotes the direction of cash flow. For example, rmta can be understood as an acronym of the phrase ‘receive mtn to airtel’, which means you would be receiving money to your Airtel account (the recipient number) from an MTN number(the sender). This format would hold for all transaction requests sent to the API. Do not forget to append the r at beginning.
    apikey The API key generated when you created the Mazzuma Business account. This can be accessed or changed via the web dashboard.
    token This is the token generated by Vodafone users in order to complete mobile money payments. This parameter is only required when the payment is to be made by a Vodafone user.

    Response

    Sample Response

    {"code":1,"status":"success","id":"XXXXX"}
    

    Sending the request would bring up a confirmation and payment prompt on the mobile phone, after which the request would return a response. The request to the API would wait until the payment succeeds or fails, and return a JSON response.

    The status denotes whether the transaction was successful or failed, and the id is the transaction ID.

    In the event of a wrong request being sent, you would receive a response of Sorry Bro :(

    In the event of the transaction failing, the request would terminate with an empty response.

    Checking a Transaction Status

    Sample Status Check Response

    {"code":200,"id":"XXXXX","status":"Successful"}
    

    If at any time you wish to check the status of a transaction, you can send a GET request to https://client.teamcyst.com/checktransaction.php?id=<id> , with the id parameter set to the transaction id you received.

    Wordpress Sites

    For WordPress websites which utilise the WooCommerce e-commerce plugin, Mazzuma offers an easy to use plugin that integrates the Mazzuma payment option into the website.

    1. Ensure that the WooCommerce plug-in in already installed and properly set-up on your website.
    2. Download the Mazzuma Plugin in zip file format for WordPress here
    3. In your WordPress dashboard, upload the zipped file and install the plugin. Don't forget to activate it after installation.
    4. Still in the WordPress dash, go to the WooCommerce plugin settings, and the Checkout tab.
    5. If the plugin correctly installed, there should be a Mazzuma payment option among the payment gateways listed at the bottom of the page. However, it would not be enabled.
    6. Select the Mazzuma gateway, and you would be taken to the plugin configuration page.
    7. Here, first enable the plugin, and then add the API key generated from the dashboard. Please note payments would not work without this API key. Once done, hit save.
    8. Mazzuma should now be listed as an enabled payment gateway, and your customers would see the option to pay using Mazzuma at checkout pages on your site. Clicking that option should redirect them to the payment page
    9. Once payment is done on the payment page, you would probably want users to be directed to your site. The payment page automatically redirects the user to the URL supplied as the success_url so you might want to use your site URL for that.