Welcome,
Guest
|
|
|
Hi,
We decided to come up with a simplified PHP example for you guys. All you need to do is:
If all goes well, you'll need to have a look at the codes and ensure you understand them line by line before you think about implementing the same on your application. Your feedback is highly appreciated. |
Regards,
Lazaro Ong'ele Web Developer Skype: Lazrotep +254-020-249-5438 ; +254-706-191-729 Dagoretti Lane, Off Naivasha Road. Facebook: www.facebook.com/pesapal Twitter: twitter.com/PesaPal Helpdesk: support.pesapal.com This e-mail address is being protected from spambots. You need JavaScript enabled to view it.
Last Edit: 2 years, 7 months ago by lazro.
|
|
Any security implications about leaving the file dbconnector.php in a public place?
|
|
|
It is bringing this error when i run it: Could not enter transaction details: Field 'trackingId' doesn't have a default value
|
|
|
Hi,
The trackingId is the order id you are supposed to generate then send to Pesapal. Please ensure you are generating it and sending it in your API call. This is a demo entirely for learning purposes after which you can implement the integration securely. |
|
|
Can someone please assist me on how i can integrate pesapal to my open cart...am using version 2.0.0.0
|
|
|
Hi Infomallnet,
I have the plugin you are looking for on www.opencart.com/index.php?route=extensi...p;extension_id=12674 |
|
|
Hi
Is it possible to use the example code provided here in a local server like localhost and if not, how can I modify it to run in my local environment? Thanks in advance |
|
|
Hi Asopia,
Yes it is possible. |
|
|
Hi Odhiambo,
Kindly give me a guide of how to do that. I'll appreciate |
|
|
Okay in Tanzania every Mpesa user has a secret code they have to insert when making any kind of payment.. see what I dont get is how does this one work I did everything inserted everything in the right place but still when I try to make payments, which I am not even sure how to, it takes me to a page Iframe that has two links business and personal... where do I insert my security code the four number code for making payments how do I do that.
|
|
|
Hello,
Share the link to your system. I would like to see what you have. |
Regards,
Lazaro Ong'ele Web Developer Skype: Lazrotep +254-020-249-5438 ; +254-706-191-729 Dagoretti Lane, Off Naivasha Road. Facebook: www.facebook.com/pesapal Twitter: twitter.com/PesaPal Helpdesk: support.pesapal.com This e-mail address is being protected from spambots. You need JavaScript enabled to view it.
The following user(s) said Thank You: muddyjeff12
|
|
eefaster.us
|
|
|
Hi,
Something is off in your iframe.php file. Please attach it (do not include your key and secret) CSS issues : Why do you have the $sitelink variable as eefaster.us/pesapalPHPExample yet you do not have the pesapalPHPEaxmple folder, you've extracted the files in your root...? |
Regards,
Lazaro Ong'ele Web Developer Skype: Lazrotep +254-020-249-5438 ; +254-706-191-729 Dagoretti Lane, Off Naivasha Road. Facebook: www.facebook.com/pesapal Twitter: twitter.com/PesaPal Helpdesk: support.pesapal.com This e-mail address is being protected from spambots. You need JavaScript enabled to view it.
Last Edit: 4 years, 6 months ago by lazro.
|
|
My Iframe is here
<?php include_once('../top.php'); require_once('OAuth.php'); require_once('../db/dbconnector.php'); if($_POST['api']) $api = 'demo.pesapal.com'; else $api = 'www.pesapal.com'; $token = $params = NULL; $iframelink = $api.'/api/PostPesapalDirectOrderV4'; //Kenyan keys $consumer_key = ""; $consumer_secret = ""; $signature_method = new OAuthSignatureMethod_HMAC_SHA1(); $consumer = new OAuthConsumer($consumer_key, $consumer_secret); //get form details if(!$_POST['reference']){ $ref = str_repeat('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',5); $_POST['reference'] = substr(str_shuffle($ref),0,10); } $amount = str_replace(',','',$_POST['amount']); // remove thousands seperator if included $amount = number_format($amount, 2); //format amount to 2 decimal places $desc = $_POST['description']; $type = 'MERCHANT'; $first_name = $_POST['first_name']; $last_name = $_POST['last_name']; $email = $_POST['email']; $phonenumber = $_POST['phone_number']; $currency = $_POST['currency']; $reference = $_POST['reference']; //unique transaction id, generated by merchant. $callback_url = '[domain]/pesapalPHPExample/redirect.php'; //URL user to be redirected to after payment //Record order in your database. $database = new pesapalDatabase(); $database->store($_POST); $post_xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?> <PesapalDirectOrderInfo >"; $post_xml = htmlentities($post_xml); //post transaction to pesapal $iframe_src = OAuthRequest::from_consumer_and_token($consumer, $token, "GET", $iframelink, $params); $iframe_src->set_parameter("oauth_callback", $callback_url); $iframe_src->set_parameter("pesapal_request_data", $post_xml); $iframe_src->sign_request($signature_method, $consumer, $token); include('../pay.php'); include_once('../top.php'); ?> |
|
|
muddyjeff12,
Kindly sort the css issue first. The iframe code seems to be fine but there is a disconnect. Let your page look like staging.verviant.com/pesapalPHPExample |
Regards,
Lazaro Ong'ele Web Developer Skype: Lazrotep +254-020-249-5438 ; +254-706-191-729 Dagoretti Lane, Off Naivasha Road. Facebook: www.facebook.com/pesapal Twitter: twitter.com/PesaPal Helpdesk: support.pesapal.com This e-mail address is being protected from spambots. You need JavaScript enabled to view it. |
|