May 1, 2024
How To Intergrate M-Pesa B2C With Your Website In Php
In this tutorial Ill show you how to intergrate m-pesa b2c with your website in php1.Create a b2c file and paste in the following code:<?php /* Urls */$access_token_url = ‘https://sandbox.safaricom.co.ke/oauth/v1/generate?grant_type=client_credentials’;$b2c_url = ‘https://sandbox.safaricom.co.ke/mpesa/b2c/v1/paymentrequest’; /* Required Variables */$consumerKey = ‘YgreYNuYW5xIVooFrZgIhQMvvBGr2Pe2’; # Fill with your app Consumer Key$consumerSecret = ‘699oGg0C1XdMoWOA’; # Fill with your app Secret$headers = [‘Content-Type:application/json; […]
1 min read