This plugin is dependent on Woocommerce Plugin and for it to work it needs details from Daraja portal by Safaricom. This plugin does not work with Kopokopo Till Numbers, since the integration is different. There is usually a test paybill and online passkey provided on Daraja Portal for testing purpose. Use this paybill and passkey provided by Safaricom for testing on Sandbox:
- Paybill Number: 174379
- Online Passkey: bfb279f9aa9bdbcf158e97dd71a467cd2e0c893059b10f78e6b72ada1ed2c919
You can use these above details with the Sandbox Consumer Key and Consumer Secret for testing the free plugin which is in the WordPress Plugins page. When testing with your mobile number, test with products with less amount like Ksh. 1 since the amount will be deducted from your M-PESA Account and reversed the next day. While testing, if you do not get an STK Push to authorize the payment check if the amount you are testing with is less than your M-PESA balance.
In order to receive payments in your website you first need to apply for a Till Number or Paybill Number from Safaricom. You can request for the requirements by writing an email to M-PESABusiness@safaricom.co.ke. While requesting for a Till Number, make sure the payment settlement type is Bank and not M-PESA so that you will get Head Office Number, Store Number and Till Number. If the settlement type is M-PESA, it will not be possible to integrate to M-PESA through Daraja.
There are few steps needed in order to receive payments in your paybill number or till number.
Till Number Integration
This integration will need access to M-PESA portal .
Your account can be set up by writing an email to M-PESABusiness@safaricom.co.ke to request for it.
Once you have the username and temporary password sent to your email, follow the steps on this link to get the certificates used to access the portal.
Once logged into the M-PESA portal, create a new operator using the Store Number provided by clicking on Browse Organizations and then the Add button and choose API as the access channel.
Make sure you assign the operator Business Administrator or Business Manager role and fill in the details requested.
The new operator will appear under Children in the Overview menu.
The Store Number used here will be used in Daraja for the Go Live process.
Paybill Number Integration
You will need access to M-PESA portal just to confirm if everything is ok.
No need to create an operator in this case but just verify that the existing operator has a Business Manager or Business Administrator Role.
The Paybill Number will be used in the Go Live process in Daraja.
Go Live Process
The Go Live process is in Daraja Portal.
If you do not have an account, create one by clicking on the link above.
There is a Go Live option on the menu, click on it and you will see a form to fill in the organization details related to the Paybill or Till number to Go Live with. This is a sample screenshot showing the first step of filling in the organization information:
- Verification Type – Select Shortcode.
- Organization Shortcode – In the case of Till number, use the new Store Number created in the M-PESA Organization Portal as the Organization Short Code while in the case of Paybill Number, use the Paybill Number.
- Organization Name – Name of your registered company that owns the Paybill or Till Number.
- M-Pesa User Name – is the one used while logging in in the M-PESA Organization portal to create the operator.
In the Go Live step with One Time Pin Confirmation , make sure you select the M-PESA Express or Lipa Na M-PESA Production product, if it is not available then it means there is a step missed during the set up. The One Time Pin SMS is sent to your phone number that manages the Till Number or Paybill. Select the M-PESA Express or Lipa Na M-PESA Production option, fill in the One Time Pin and click on Go Live button.
After successfully completing the process, you should see a popup like this one:
The production URLs will be sent to your email. The Lipa Na M-PESA online passkey will also be sent on the same day or the next day after Go Live process is completed successfully. In case there is a delay in the Online Passkey being sent, write an email to firstname.lastname@example.org to inquire about it.
After successfully going live, a new app will be created in your Daraja account. The app usually starts with prefix Prod(Prod-xxxxx-xxx-xx). This is where you will get the Consumer Key and Consumer Secret to use in the plugin combined with the pass key that will be sent on email. To view the production app details, you will need to select the Active Company from the drop down with all the companies and Sandbox option as shown below:
This is a sample new production app with the Prod prefix. The New label should disappear after it’s approved and you receive the pass key on email:
Pro-Version Plugin Settings
When you choose Till Number identifier type, The Store Number will be the one used for Go Live and the Shortcode will be the Till Number. When the choice is Paybill identifier type, the Head Office Number will be the paybill number and the shortcode will also be the paybill number.
The Passkey is the one sent on the email while the Consumer Key and Consumer Secret is the one on the Daraja production app created after Go Live. You can also choose which status the order should be updated to after successful payment.