Please let me work for you!

I will surely give you a great offer now!

Dear Sir/Madam,

My name is Brian Mbiki and I created this platform with products to help you:

1. Start a Payment processing gateway.

2. Integrate Mpesa with any website or Mobile App.

3. Add any form of Payment gateway to your website or Mobile App.

I am willing to cut down all my costs now.

Just write to me via WhatsApp +254706745202 and I will surely surprise you with  a great offer.



In this post, I will dive in explaining every detail like to a 2 year old baby on how to integrate your core PHP website with Mpesa C2B.

What is C2B Mpesa integration?

Simple. It is that Mpesa linking feature that will help customers pay you automatically then you can process their orders or continue with whatever business logic your website does using other payment options.

What is a core PHP website?

Once more. Simple. It is a website that is built in PHP without those other stuff you hear known as CMS, Frameworks etc. Just plain PHP opening your notepad or any text editor and writing your website from there and processing data using PHP to maybe a Mysql database.

Types of Mpesa C2B API integration to have in mind before deciding on Integrating your website with an Mpesa Payment option.

1. MpesaC2B General API:

This is whereby users pay using their phones without having to touch your website or app and everything else is processed by your website/server automatically. In this case, your website users do not need to visit your website or app or be online to make a payment.

The technical aspects involved here are:

a) . Url registration: ==> This involves telling Mpesa servers the urls which they will need to communicate to in case a payment is received on a yourMpesa  Paybill or Till Number.

b). Validation : ===> The transaction received is validated on its legitimacy.

c). Confirmation:===> If valid, the Mpesa transaction is confirmed and the business logic is executed.


So now, let us integrate a C2B Mpesa gateway to process transactions from your clients.

Before I dive too deep, here is an Mpesa C2B Integration Assistant that through a few Clicks will help integrate Mpesa C2B API in your website within minutes without any coding skills. Just add it to card and checkout, download and follow the instructions located here: How to use the Mpesa C2B API Integration Assistant

$50.00 each Mpesa C2B API Integration Assistant


 Requirements to Integrate your website with Mpesa C2B API:

1. The above Mpesa API integration assistant.

2. A C2B Paybill from Safaricom.

3. A developer account from Safaricom.

4. Webmaster knowledge.

 Process to integrate C2B.

a) Set up the Payments processor gateway in your server/Hosting Cpanel. Since most people use Cpanel these days, I will explain using a Cpanel. The Apache server should be running PHP and Mysql and support PHP 7+. Let this be set in its own folder in your cpanel. If your main website is running in the main directory, consider a folder like this maindirectory/payments

b) Add the C2B Mpesa integration plugin to the above Payments processor.

After the above procedure, you are now ready with a payment gateway which can automatically process Mpesa payments from Clients. However, you are not yet ready to process the orders against these transactions.

c) Now set the Core PHP Payments Mpesa integration plugin. This is the plugin that connects your order process to above processed payments.

  •  Create a folder inside your main directory and call it "Mpesa" or any other name you prefer. It is advisable to choose another name apart from Mpesa.
  • Inside this folder, upload the Core PHP Mpesa plugin zipped file you downloaded from your Payment processor script account.
  • Unzip it.

d). Now, this step requires PHP knowledge, you can hire a PHP developer or our Team to do this part for you.

  1. Locate in your core PHP website where you are processing the orders. Examples.

[Code block to add orders to cart]
[Code block to select Payment methods

// Here, add "Mpesa"

Examples: If using a Form:

<form action="action-page-here" method ="POST">
<option hidden>Select Payment method</option>
<option>Other method</option>

<!----type Mpesa in the case I typed above--->



//This is just an example. You well know how your code selects payments methods. Could be plain, from form, or form fetching from Database or simply you haven't attended 
a Payment method selection before. I suggest forms fetching from DB.


On the Form action file, Add below code:


$payment_method = $_POST['method'];

require_once "mpesa/core_php_mpesa.php";


//Other payment methods if any




Open your "Payment successful page" and include code to factor in any Payments from Mpesa. This is upon you as per the functionality of your Core PHP website.

Recall that all Payments are deposited on the Payments core Gateway and you can view them from the admin end under Transactions--->Mpesa

Now you are done. Test your work.

You have successfully integrated C2B Mpesa payments with your Core script.