M-Pesa

Overview

M-Pesa — payment method to perform payments based on the customer phone number. This method allows you to process purchases by using Payment Page and Gate, payouts and refunds are processed by using Gate.

General information

Payment method type E-wallet
Countries and regions Kenya
Payment currencies KES
Currency conversion
Purchases +
Payouts +
Stored credentials payments
Full refunds +
Partial refunds +
Chargebacks
Notes No possibility of pre-selecting M-Pesa on Payment Page
Onboarding and access fee Refer to your ECommPay Key Account Manager

Interaction diagram

Payment processing by using the M-Pesa payment method requires merchant's web service, one of ECommPay interfaces, and the ECommPay payment platform, as well as provider's technical facilities. In the M-Pesa method, you perform purchases through Payment Page or Gate while payouts and refunds are processed by using Gate.

Operations support

  Interfaces Amounts, KES Times
Payment Page CMS Plugins Gate Dashboard (Old Dashboard) minimum maximum basic threshold
Purchases + + 1.00 500,000.00 up to 10 minutes *
Payouts + 10.00 200,000.00 up to 10 minutes *
Full refunds + up to 10 minutes *
Partial refunds + up to 10 minutes *
Note:

* For more information refer to your ECommPay Key Account Manager.

  • The basic time is the average estimated time between the moment a payment is initiated in the payment platform to the moment the payment result is sent to the initiator. The basic time evaluation is made on the assumption of normal operation of all technical facilities and communication channels and typical customer behaviour (if any input from customer is required). Use the basic time to estimate when to react to the absence of payment result notifications or when to check payment status.
  • The threshold time is the maximum possible time between the moment a payment is initiated in the payment platform to the moment the initiator receives the callback with the payment result. A payment is automatically declined, if its waiting time exceeds the threshold time. For individual setting of the threshold time limit, contact ECommPay technical support.

Processing scenarios

In the M-Pesa method, purchases, refunds, and payouts follow different processing procedures. To perform a purchase operation, you need to redirect customer to the M-Pesa service, while to initiate a refund or payout, you need to notify customer via merchant's web service.

Figure: Payment by using Payment Page

Figure: Payment by using Gate

Figure: Refund by using Gate

Figure: Payout by using Gate

Purchase via Payment Page

General information

In the M-Pesa method, to perform a purchase by using Payment Page, the merchant web service should send a request with all the required parameters and signature to the ECommPay URL and get the callback with the payment result from the payment platform. When opening Payment Page, you can have Payment Page opened with the M-Pesa method selected. For more information about preselecting payment methods, see in Preselecting payment method.

The full sequence and particularities of the purchase process are provided below.

Figure: Purchase sequence when using Payment Page

  1. Customer initiates payment by using the web service.
  2. The merchant web service sends to the specified ECommPay URL the payment request for processing the payment by using Payment Page.
  3. The payment platform receives the request for processing the payment by using Payment Page.
  4. The payment platform performs the initial request processing that involves validation of the required parameters and signature.
  5. The requested payment form is generated into the ECommPay payment platform as specified in the project settings and the request parameters.
  6. The payment form is displayed to the customer.
  7. The customer selects the M-Pesa payment method and agrees to use the method.
  8. The payment platform receives the payment request for payment processing in the M-Pesa service.
  9. The payment platform performs the internal payment request processing and sends it to the M-Pesa service.
  10. The payment request is processed on the M-Pesa side.
  11. The M-Pesa service generates the data for redirecting the customer to the M-Pesa form and sends it to the payment platform.
  12. The payment platform sends to Payment Page the data for redirecting the customer to the M-Pesa form.
  13. The customer is redirected to the M-Pesa form.
  14. The customer completes all the required steps.
  15. The payment is processed on the M-Pesa side.
  16. M-Pesa service sends the payment result notification to the payment platform.
  17. The payment platform sends the callback to the web service.
  18. The payment platform sends payment results to Payment Page.
  19. A page with the payment result information is displayed to the customer.

The sections that follow discuss in more details the request format and the Payment Page parameters to use in the M-Pesa payment method and provide the information on the format of callbacks with payment results. For the general information on how to use the API, see Payment Page API Description.

Request format

There are several things you need to consider when using the M-Pesa method:

  1. You must provide values for the basic minimum of parameters. Listed below are the parameters that are mandatory for any payment method:
    • project_id—the project ID obtained from ECommPay
    • payment_id—payment ID unique within the project
    • payment_currency—payment currency in ISO-4217 alpha-3 format
    • payment_amount—payment amount in minor units
    • customer_id—customer ID unique within the project
  2. The currency of payment can only be KES.
  3. There is one more mandatory parameter—payment_description.
  4. If required, you can also add any other additional parameters Payment Page supports.
  5. After you specify all the parameters you need, you must create the signature for the request. For instructions on how to sign a payment request, see Signature generation and verification.

Thus, a correct payment request in the M-Pesa method must include project and payment IDs, payment description, the currency and the amount of a payment in the appropriate currency, as shown in the following example:

EPayWidget.run(
    { project_id: 103, 
      payment_id: 'X03936', 
      payment_amount: 3500, 
      payment_currency: 'KES,   
      customer_id: 'customer1',
      payment_description: 'test PP sale', 
      signature: "kUi8x9dKHAVNU0FYldJrxh4yo+52Kt8KU+Y1Y4HASCQ9vySO\/RLC
                                 vhtT4DqtVUkDJrOcZzUCwX6R\/ekpZhkIQg=="
    }
)

For information about all parameters available in the M-Pesa method, see Payment Page invocation parameters.

Callback format

The M-Pesa method uses the standard format for callbacks to deliver purchase results. For more information, see Callbacks.

The following is the example of a callback with an information about successful 10.00 KES purchase made by customer from phone number 254798365268 in the 255 project.

Figure: Example of a successful purchase callback

{
        "project_id": 255,
        "payment": {
            "id": "TEST_155",
            "type": "purchase",
            "status": "success",
            "date": "2019-02-18T16:23:33+0000",
            "method": "mpesa",
            "sum": {
                "amount": 1000,
                "currency": "KES"
            },
            "description": "TEST_155"
        },
        "account": {
            "number": "254798365268"
        },
        "customer": {
            "phone": "254798365268"
        },
        "operation": {
            "id": 828000003219,
            "type": "sale",
            "status": "success",
            "date": "2019-02-18T16:23:33+0000",
            "created_date": "2019-02-18T16:21:32+0000",
            "request_id": "8725679f13368befbe20ee05151ebdb0563edf88a5c71166a0a2fab",
            "sum_initial": {
                "amount": 1000,
                "currency": "KES"
            },
            "sum_converted": {
                "amount": 1000,
                "currency": "KES"
            },
            "provider": {
                "id": 1150,
                "payment_id": "6826979082",
                "date": "2019-02-18T16:22:58+0000",
                "auth_code": ""
            },
            "code": "0",
            "message": "Success"
        },
        "signature": "10hBlstO4unTNCKpp6zVgUoiGprO2OhkZvJ7RbnmLnB1Ru6da
                               5K5+aagnXYiBtjd03e3+T7TTiHoF54/ScJwyQ=="
    }

The following is the example of a callback for a purchase declined due to insufficient funds on customer account.

Figure: Example of a declined purchase callback

{
        "project_id": 255,
        "payment": {
            "id": "TEST_155",
            "type": "purchase",
            "status": "decline",
            "date": "2019-02-13T14:25:07+0000",
            "method": "mpesa",
            "sum": {
                "amount": 200,
                "currency": "KES"
            },
            "description": "ECT_TEST_15500669030661"
        },
        "account": {
            "number": "0798365267"
        },
        "customer": {
            "phone": "0798365267"
        },
        "operation": {
            "id": 17513000003139,
            "type": "sale",
            "status": "decline",
            "date": "2019-02-13T14:25:07+0000",
            "created_date": "2019-02-13T14:21:25+0000",
            "request_id": "932570d281daa6b2f3d29cbe6f6fb258c5e328d2979530ee0af",
            "sum_initial": {
                "amount": 200,
                "currency": "KES"
            },
            "sum_converted": {
                "amount": 200,
                "currency": "KES"
            },
            "provider": {
                "id": 1150,
                "payment_id": "7737999295",
                "date": "2019-02-13T14:24:43+0000",
                "auth_code": ""
            },
            "code": "20105",
            "message": "Insufficient funds on customer account"
        },
        "signature": "ME5ZrgXgK1ewc4oVFFhptPn7SC4Dpds/SObifUU5B9BjioarBBLO4f
                                         G2MGG5TxVWnKcaWFzV5vN15LEu59Zjpg=="
    }

Related topics

The following topics might be useful when implementing payments through Payment Page:

Purchase via Gate

General information

In the M-Pesa method, when processing a purchase by using Gate, the merchant web service is required to do the following:

  1. Send a request with all the required parameters and signature to the ECommPay URL.
  2. Perform redirecting customer to the M-Pesa service.
  3. Get the callback with the payment result from the payment platform.

Figure: Purchase sequence when using Gate

  1. Customer initiates payment on the merchant web service by using the M-Pesa method.
  2. The web service sends the request for processing the payment by using Gate to the specified ECommPay URL.
  3. The payment platform receives the request for processing the payment by using Gate.
  4. The payment platform performs the initial request processing that includes validation of the required parameters and signature.
  5. The payment platform sends to the web service response with request receipt confirmation and correctness check result.
  6. The payment platform performs the internal payment request processing and sends it to the M-Pesa service.
  7. The payment request is processed on the M-Pesa side.
  8. The M-Pesa service generates the data for redirecting the customer to the M-Pesa service and sends it to the payment platform.
  9. The payment platform sends to the web service the callback that delivers the data for redirecting the customer to the M-Pesa form.
  10. The customer is redirected to the M-Pesa service.
  11. The customer completes required steps.
  12. The payment is processed on the M-Pesa side.
  13. The M-Pesa service sends the payment result notification to the payment platform.
  14. The payment platform sends the callback to the web service.
  15. The customer receives the payment result from the web service.

The sections that follow discuss in more details the request format and the Gate parameters to use in the M-Pesa payment method and provide the information on the format of callbacks with purchase results.

Request format

There are several things you must consider when using purchase requests in the M-Pesa method:
  1. You send purchase requests by sending the /v2/payment/mpesa/sale request by using HTTP method POST.
  2. The following objects and parameters must be specified in any request:
    • general—object that contains general purchase information:
      • project_id—the project ID obtained from ECommPay
      • payment_id—payment ID unique within the project
      • signature—signature created after you specify all the required parameters. For more information about signature generation, see Signature generation and verification
    • payment—object that contains purchase information:
      • amount—purchase amount in minor units
      • currency—purchase currency in ISO-4217 alpha-3 format
    • customer—object that contains customer information:
      • id—unique ID within the merchant project
      • ip_address—customer IP address
    • account—object that contains customer account information:
      • number—customer mobile number
  3. The currency of purchase can only be KES.
  4. If required, you can also add any other additional parameters Gate supports.

Thus, a correct payment request in the M-Pesa method must include project and payment IDs, IP address, customer mobile number, currency using Kenyan shilling and amount of the purchase, as shown in the following example:

Figure: Example of a purchase request

{
  "general": {
    "project_id": 255,
    "payment_id": "TEST_155",
    "signature": "8oDYXcwOawdFy41j1fl3ORHioZP2/fpSEpoFohjcvfjlOS8
                       Ya/vYj2f4cI42K4bd/Pwue2dhgQkPYTuNMh7h3Q=="
  },
  "customer": {
    "ip_address": "45.76.37.192",
    "id": "customer1"
  },
  "payment": {
    "amount": 1000,
    "currency": "KES"
  },
  "account": {
    "number": "254798465267"
  }
}

Formats of the customer redirection data

To redirect a customer from the web service to the M-Pesa site, you must receive a callback from the payment platform containing the URL for redirection in the redirect_data.url parameter and data to be sent in the request body in the redirect_data.body parameter, and use these parameters when opening the HTML page using the method specified in the redirect_data.method parameter.

The following is the callback fragment containing the redirection data.

"redirect_data": {
            "method": "GET",
            "body": [],
            "encrypted": [],
            "url": "http://test.com"
        }

Callback format

The M-Pesa method uses the standard format for callbacks to deliver purchase results. For more information, see Callbacks.

The following is the example of a callback with an information about successful 10.00 KES purchase made by customer from phone number 254798365268 in the 255 project.

Figure: Example of a successful purchase callback

{
        "project_id": 255,
        "payment": {
            "id": "TEST_155",
            "type": "purchase",
            "status": "success",
            "date": "2019-02-18T16:23:33+0000",
            "method": "mpesa",
            "sum": {
                "amount": 1000,
                "currency": "KES"
            },
            "description": "TEST_155"
        },
        "account": {
            "number": "254798365268"
        },
        "customer": {
            "phone": "254798365268"
        },
        "operation": {
            "id": 828000003219,
            "type": "sale",
            "status": "success",
            "date": "2019-02-18T16:23:33+0000",
            "created_date": "2019-02-18T16:21:32+0000",
            "request_id": "8725679f13368befbe20ee05151ebdb0563edf88a5c71166a0a2fab",
            "sum_initial": {
                "amount": 1000,
                "currency": "KES"
            },
            "sum_converted": {
                "amount": 1000,
                "currency": "KES"
            },
            "provider": {
                "id": 1150,
                "payment_id": "6826979082",
                "date": "2019-02-18T16:22:58+0000",
                "auth_code": ""
            },
            "code": "0",
            "message": "Success"
        },
        "signature": "10hBlstO4unTNCKpp6zVgUoiGprO2OhkZvJ7RbnmLnB1Ru6da
                               5K5+aagnXYiBtjd03e3+T7TTiHoF54/ScJwyQ=="
    }

The following is the example of a callback for a purchase declined due to insufficient funds on customer account.

Figure: Example of a declined purchase callback

{
        "project_id": 255,
        "payment": {
            "id": "TEST_155",
            "type": "purchase",
            "status": "decline",
            "date": "2019-02-13T14:25:07+0000",
            "method": "mpesa",
            "sum": {
                "amount": 200,
                "currency": "KES"
            },
            "description": "ECT_TEST_15500669030661"
        },
        "account": {
            "number": "0798365267"
        },
        "customer": {
            "phone": "0798365267"
        },
        "operation": {
            "id": 17513000003139,
            "type": "sale",
            "status": "decline",
            "date": "2019-02-13T14:25:07+0000",
            "created_date": "2019-02-13T14:21:25+0000",
            "request_id": "932570d281daa6b2f3d29cbe6f6fb258c5e328d2979530ee0af",
            "sum_initial": {
                "amount": 200,
                "currency": "KES"
            },
            "sum_converted": {
                "amount": 200,
                "currency": "KES"
            },
            "provider": {
                "id": 1150,
                "payment_id": "7737999295",
                "date": "2019-02-13T14:24:43+0000",
                "auth_code": ""
            },
            "code": "20105",
            "message": "Insufficient funds on customer account"
        },
        "signature": "ME5ZrgXgK1ewc4oVFFhptPn7SC4Dpds/SObifUU5B9BjioarBBLO4f
                                         G2MGG5TxVWnKcaWFzV5vN15LEu59Zjpg=="
    }

Related topics

The following topics might be useful when implementing payments through Gate:

Refund via Gate

General information

M-Pesa supports full and partial refunds processing. In the M-Pesa method, any refund follows the usual procedure which is common to Gate: merchant's web service sends a request with all the required parameters and signature to ECommPay URL, Gate accepts the request and redirects to the payment platform for further processing. The full sequence of the refund process is provided below.

Figure: Refund sequence when using Gate

  1. Customer orders a refund on the bank account.
  2. Merchant's web service sends to the appropriate ECommPay URL the refund request for processing by using Gate.
  3. The payment platform receives the request for the refund processing by using Gate.
  4. The payment platform performs the initial request processing that includes validation of the required parameters and signature.
  5. The payment platform sends to the web service response with request receipt confirmation and correctness check result.
  6. Processed request is sent to the M-Pesa service.
  7. The refund is processed on the M-Pesa side.
  8. The M-Pesa service sends the result notification to the ECommPay payment platform.
  9. The ECommPay payment platform sends a callback to the web service.
  10. The customer receives the refund processing results in the form specific to the web service.

The sections that follow discuss in more details the request format and the Gate parameters to use in the M-Pesa payment method and provide the information on the format of callbacks with refund results.

Request format

There are several things you must consider when using refund requests in the M-Pesa method:
  1. You perform refunds by sending the /v2/payment/mpesa/refund request by using HTTP method POST.
  2. The following objects and parameters must be specified in any request:
    • general—object that contains general purchase information:
      • project_id—the project ID obtained from ECommPay
      • payment_id—payment ID unique within the project
      • signature—signature created after you specify all the required parameters. For more information about signature generation, see Signature generation and verification
    • Object payment—refund information:
      • description—comment or description
      • amount—refund amount in minor units (mandatory for partial refund only)
      • currency—refund currency in ISO-4217 alpha-3 format (mandatory for partial refund only)
  3. The currency of refund can only be KES.
  4. If required, you can also add any other additional parameters Gate supports.

Thus, a correct refund request in the M-Pesa method must include project and payment IDs, as shown in the following example:

Figure: Example of a refund request

{
  "general": {
    "project_id": 32290,
    "payment_id":"mpesa-refund",
    "signature": "ME5ZrgXgK1ewc4oVFFhptPn7SC4Dpds/SObifUU5B9BjioarBBLO4...=="
  },
  "payment": {
    "amount": 105,
    "currency": "KES",
    "description": "refund"
  }
}

Callback format

The M-Pesa method uses the standard format for callbacks to deliver refund results. For more information, see Callbacks.

The following is an example of callback with an information about successful partial refund in the 257 project.

Figure: Example of a successful refund callback

 {
        "project_id": 257,
        "payment": {
            "id": "TEST_155",
            "type": "purchase",
            "status": "partially refunded",
            "date": "2019-02-18T06:18:01+0000",
            "method": "mpesa",
            "sum": {
                "amount": 40000,
                "currency": "KES"
            },
            "description": "TEST_155"
        },
        "operation": {
            "id": 258000003219,
            "type": "refund",
            "status": "success",
            "date": "2019-02-18T06:18:01+0000",
            "created_date": "2019-02-18T06:17:52+0000",
            "request_id": "dda6eb029059832eb1",
            "sum_initial": {
                "amount": 10000,
                "currency": "KES"
            },
            "sum_converted": {
                "amount": 10000,
                "currency": "KES"
            },
            "provider": {
                "id": 1149,
                "payment_id": "25960166",
                "date": "2019-02-18T06:18:00+0000",
                "auth_code": ""
            },
            "code": "0",
            "message": "Success"
        },
        "signature": "L3DDG4SK3dukjBjT8ZZfOL4X/jE1/BgKp5LI2+putJA/U4Dxog
                                 WEKCqbOWewI6dt4C7EX1BEkKL4QGH1nNNWRw=="
    }

Here is an example of callback for a refund declined due to refund amount being more than init amount.

Figure: Example of a declined refund callback

 {
        "project_id": 257,
        "payment": {
            "id": "TEST_155",
            "type": "purchase",
            "status": "success",
            "date": "2019-02-13T12:35:49+0000",
            "method": "mpesa",
            "sum": {
                "amount": 50000,
                "currency": "KES"
            },
            "description": "TEST_155"
        },
        "operation": {
            "id": 258000003164,
            "type": "refund",
            "status": "decline",
            "date": "2019-02-15T13:36:28+0000",
            "created_date": "2019-02-15T13:36:27+0000",
            "request_id": "354c11cdc403a2",
            "sum_initial": {
                "amount": 10000,
                "currency": "KES"
            },
            "sum_converted": {
                "amount": 10000,
                "currency": "KES"
            },
            "provider": {
                "id": 1149,
                "payment_id": "",
                "auth_code": ""
            },
            "code": "3283",
            "message": "Refund amount more than init amount"
        },
        "signature": "1aw64dc0nH3bKt4XJr8F6UXhC352gaSGEvSrHz8zsg4mOR3kcH
                                 GRYAxYPI9sqQ57/2KWDwhjfNf2XY2ZuDMovg=="
    }

Related topics

The following topics might be useful when implementing payments through Gate:

Payout via Gate

General information

In the M-Pesa method, any payout follows the usual procedure which is common to Gate: merchant's web service sends a request with all the required parameters and signature to ECommPay URL, Gate accepts the request and redirects to the payment platform for further processing. The full sequence of the payout process is provided below.

Figure: Payout sequence when using Gate

  1. Customer orders a payout on the bank account.
  2. Merchant's web service sends to the appropriate ECommPay URL the refund request for processing by using Gate.
  3. The payment platform receives the request for the payout processing by using Gate.
  4. The payment platform performs the initial request processing that includes validation of the required parameters and signature.
  5. The payment platform sends to the web service response with request receipt confirmation and correctness check result.
  6. Processed request is sent to the M-Pesa service.
  7. The payout is processed on the M-Pesa side.
  8. The M-Pesa service sends the result notification to the ECommPay payment platform.
  9. The ECommPay payment platform sends a callback to the web service.
  10. The customer receives the payout processing results in the form specific to the web service.

The sections that follow discuss in more details the request format and the Gate parameters to use in the M-Pesa payment method and provide the information on the format of callbacks with payout results.

Request format

There are several things you must consider when using payout requests in the M-Pesa method:
  1. You send payout requests by sending the /v2/payment/mpesa/payout request by using HTTP method POST.
  2. The following objects and parameters must be specified in any request:
    • general—object that contains general purchase information:
      • project_id—the project ID obtained from ECommPay
      • payment_id—payment ID unique within the project
      • signature—signature created after you specify all the required parameters. For more information about signature generation, see Signature generation and verification
    • payment—object that contains purchase information:
      • amount—purchase amount in minor units
      • currency—purchase currency in ISO-4217 alpha-3 format
    • customer—object that contains customer information:
      • ip_address—customer IP address
    • account—object that contains customer account information:
      • number—customer mobile number
  3. The currency of payout can only be KES.
  4. If required, you can also add any other additional parameters Gate supports.
Thus, a correct payout request in the M-Pesa method must include project and payment IDs, IP address, customer mobile number, currency and amount of the payout, as shown in the following example:

Figure: Payout request example

{
  "general": {
    "project_id": 579,
    "payment_id": "Mpesa-Payout-001",
    "signature": "l6BHX+YbCbbYmVUNfBoUS1HyIb7zhEnbf1288ppHe77
               HLvPJ/NDZUskXxQhuFnlnY4nLyYmikvBrZNsb99D20Q=="
  },
  "account": {
    "number": "798365267"
  },
  "customer": {
    "ip_address": "127.0.0.1"
  },
  "payment": {
    "amount": 1000,
    "currency": "KES"
  }
}

Callback format

The M-Pesa method uses the standard format for callbacks to deliver payout results. For more information, see Callbacks.

The following is an example of callback with an information about successful 10.00 KES payout from account 798365267 made by the 22 customer in the 255 project.

Figure: Example of a successful payout callback

{
        "project_id": 255,
        "payment": {
            "id": "mpesa_payout_1112243",
            "type": "payout",
            "status": "success",
            "date": "2019-04-30T11:20:04+0000",
            "method": "mpesa",
            "sum": {
                "amount": 1000,
                "currency": "KES"
            },
            "description": "test_payout"
        },
        "account": {
            "number": "798365267"
        },
        "customer": {
            "id": "22"
        },
        "operation": {
            "id": 32826000001677,
            "type": "payout",
            "status": "success",
            "date": "2019-04-30T11:20:04+0000",
            "created_date": "2019-04-30T11:20:04+0000",
            "request_id": "db00b094f1969ed50285fce550fe2c269c2b2fb21972f9e54c1214",
            "sum_initial": {
                "amount": 1000,
                "currency": "KES"
            },
            "sum_converted": {
                "amount": 1000,
                "currency": "KES"
            },
            "provider": {
                "id": 1150,
                "payment_id": ""
            },
            "code": "0",
            "message": "Success"
        },
        "signature": "4d9g0vNsgfGg1/b7ZwT9J3wwTomFDJ77klw3/Nd8itexbeK
                           ehfXGk7xEKpMOTA0k598LijU5Rfs8bwtN771M/A=="
    }
}

The following is an example of callback for a payout declined due to insufficient funds on merchant balance.

Figure: Example of a declined payout callback

{
        "project_id": 255,
        "payment": {
            "id": "mpesa_payout_1112243",
            "type": "payout",
            "status": "decline",
            "date": "2019-04-30T11:20:04+0000",
            "method": "mpesa",
            "sum": {
                "amount": 1000,
                "currency": "KES"
            },
            "description": "test_payout"
        },
        "account": {
            "number": "798365267"
        },
        "customer": {
            "id": "22"
        },
        "errors": [
            {
                "code": "3028",
                "message": "Insufficient funds on merchant balance",
                "description": "public: BALANCE_INSUFFICIENT_FUNDS"
            }
        ],
        "operation": {
            "id": 32826000001677,
            "type": "payout",
            "status": "decline",
            "date": "2019-04-30T11:20:04+0000",
            "created_date": "2019-04-30T11:20:04+0000",
            "request_id": "db00b094f1969ed50285fce550fe2c269c2b2fb21972f9e54c1214",
            "sum_initial": {
                "amount": 1000,
                "currency": "KES"
            },
            "sum_converted": {
                "amount": 1000,
                "currency": "KES"
            },
            "provider": {
                "id": 1150,
                "payment_id": ""
            },
            "code": "3028",
            "message": "Insufficient funds on merchant balance"
        },
        "signature": "4d9g0vNsgfGg1/b7ZwT9J3wwTomFDJ77klw3/Nd8itexbeK
                           ehfXGk7xEKpMOTA0k598LijU5Rfs8bwtN771M/A=="
    }
}

Related topics

The following topics might be useful when implementing payments through Gate:

Analysis of payments results

As with other payment methods ECommPay offers, when using the M-Pesa method, you have several options to analyse the information about payments and operations performed by using the method—alone or in conjunction with other methods.

You can load and analyse all the necessary information in Dashboard, for instance you can use the analytic panels on the Analytics tab to this end.

Also, you can export the information for further analysis by using third party analytical tools. The following options are available:

  • Dashboard allows you to download reports in CSV and XLS formats—by using the tools on the Payments tab. You can perform export as a one-time download to your local computer or have payment data regularly exported and delivered to email addresses you specify.
  • Data API allows you to have payment information exported in JSON format and delivered to a URL you specify. The payment information is exported by using the /operations/get queries.

If you have any further questions regarding payment data analysis, contact ECommPay technical support.