
Look at this. It may give you an idea how to "pull" payment info about a transaction whose code the user has entered in a form. This is assuming that you have set up everything with Safcom as needed, including giving them an IP to be sending your IPN information to : public static function pull($terminal_msisdn, $password, $code) { $post_string = "<soapenv:Envelope xmlns:soapenv=\" http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ipn=\"http://ipn/\"> <soapenv:Header/> <soapenv:Body> <ipn:retrieveTransaction> <transactionCode>{$code}</transactionCode> <senderMsisdn></senderMsisdn> <terminalMsisdn>{$terminal_msisdn}</terminalMsisdn> <password>{$password}</password> </ipn:retrieveTransaction> </soapenv:Body> </soapenv:Envelope>"; $url = "https://www.safaricom.co.ke/IPN/IpnWebRetrieval"; $response = curl::post($url, $post_string); $xml = preg_replace("/(<\/?)(\w+):([^>]*>)/", "$1$2$3", $response); $xml = simplexml_load_string($xml); if (isset($xml->soapBody->ns2retrieveTransactionResponse->transaction)) { return $xml->soapBody->ns2retrieveTransactionResponse->transaction; } return false; } json_decode() 'ing the returned value will give you an object with all the info you need about the payer. $terminal_msisdn, $password are you LIPA-NA-MPESA's real msisdn and password assigned by Safcom. -- Ndungi Kyalo On 18 October 2015 at 21:53, Vincent Mosoti via skunkworks < skunkworks@lists.my.co.ke> wrote:
You may want to download their API developer guide and take a look at the 'C2B Online Checkout' one.
On Sun, Oct 18, 2015 at 3:29 PM, Joseph Gatheru via skunkworks < skunkworks@lists.my.co.ke> wrote:
Any leads on how to make a web application communicate with MPESA with a bias to Lipa na MPESA?
_______________________________________________ skunkworks mailing list skunkworks@lists.my.co.ke ------------ List info, subscribe/unsubscribe http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------
Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Vincent Mosoti, Analytics/Business Intelligence Consultant. Skype: vmmosoti Phone: +254 722 972805 LinkedIn: ke.linkedin.com/in/vmosoti
_______________________________________________ skunkworks mailing list skunkworks@lists.my.co.ke ------------ List info, subscribe/unsubscribe http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------
Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke