mpesa | M-Pesa API Package for PHP | REST library

 by   SmoDav PHP Version: v5.3.1 License: MIT

kandi X-RAY | mpesa Summary

kandi X-RAY | mpesa Summary

mpesa is a PHP library typically used in Web Services, REST applications. mpesa has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

M-Pesa API Package for PHP
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              mpesa has a low active ecosystem.
              It has 116 star(s) with 104 fork(s). There are 24 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 0 open issues and 23 have been closed. On average issues are closed in 13 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of mpesa is v5.3.1

            kandi-Quality Quality

              mpesa has 0 bugs and 0 code smells.

            kandi-Security Security

              mpesa has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              mpesa code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              mpesa is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              mpesa releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              mpesa saves you 494 person hours of effort in developing the same functionality from scratch.
              It has 1168 lines of code, 106 functions and 34 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed mpesa and discovered the below as its top functions. This is intended to give you an instant insight into mpesa implemented functionality, and help decide if they suit your requirements.
            • Push a push to the Push
            • Validate a number .
            • Submit the registration .
            • Authenticates an access token .
            • Cleans the cache .
            • Get a configuration value .
            • Register facades .
            • Get the configuration directory .
            • Send HTTP request .
            • Sets a reference .
            Get all kandi verified functions for this library.

            mpesa Key Features

            No Key Features are available at this moment for mpesa.

            mpesa Examples and Code Snippets

            No Code Snippets are available at this moment for mpesa.

            Community Discussions

            QUESTION

            How to Send a payload to a firebase OnRequest Function
            Asked 2021-Oct-23 at 15:47

            I have a firebase post function that I am trying to send some data to but the problem I am having is that I the body comes empty. I am using express for the function.

            ...

            ANSWER

            Answered 2021-Oct-23 at 15:47

            You seem to be sending the data correctly but are incorrectly using JSON.stringify(). The object is the first argument, not the second. Make it JSON.stringify(req.body) - that should work.

            You can read up more about the function over at MDN docs: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify

            Source https://stackoverflow.com/questions/69688398

            QUESTION

            Is there a way of submitting this form after using the preventDefault function?
            Asked 2021-Oct-23 at 09:23

            I am trying to check for selection in form, if selected option is cash, it submits else it calls an API and onse success response is returned the form should go ahead and submit

            My Javascipt

            ...

            ANSWER

            Answered 2021-Oct-23 at 09:23

            You can try using a global variable to store if AJAX call is successfull

            Source https://stackoverflow.com/questions/69686461

            QUESTION

            how to get dynamically the caller phone number and pass it as one of JSON key in Twilio run function wdget?
            Asked 2021-Sep-17 at 01:24

            I am new in Twilio and trying to develop an IVR that at some point runs a function (Run Fuuntion Widget). The function should send http request including the user phone number to a service provider to make payment for a product selected by the user.

            I tryed the code bellow but the variable is not getting the user phone number.

            ...

            ANSWER

            Answered 2021-Sep-17 at 01:24

            Twilio developer evangelist here.

            You will need to pass the phone number into the Function via the Run Function widget.

            You need to add a Function Parameter, for example From, and then the data you want to pass, which for the incoming phone number is {{contact.channel.address}}. Like so:

            Then you can use event.From in your Function code.

            Source https://stackoverflow.com/questions/69212335

            QUESTION

            Mpesa object has no attribute 'update'
            Asked 2021-Jun-02 at 12:09

            I would like to update the first item in the database each time a user clicks on a button but I keep getting the error every time, any assistance would be appreciated, below is the snippet.

            ...

            ANSWER

            Answered 2021-Jun-02 at 12:09

            you get first instance from filter result so model instances does not have update method. if you always have first object then instead of doing that, try to use instance save method;

            Source https://stackoverflow.com/questions/67804508

            QUESTION

            How to solve Safaricom C2B error "Unable to identify proxy for host"
            Asked 2021-Apr-30 at 13:22

            I am working with Safaricom Mpesa Daraja Api using the test credentials. Everything was working okay but suddennly I start getting the error.

            ...

            ANSWER

            Answered 2021-Apr-30 at 13:22

            Turns out the only way to solve this is to contact Safaricom Api Support team and ask them to rectify the issue.

            Source https://stackoverflow.com/questions/67312311

            QUESTION

            'bool' object has no attribute 'save'
            Asked 2021-Apr-26 at 22:15

            I am trying to work on a Django app and I would like to check if the boolean object in the database is False and save it as True, but every time I get the error above, I would appreciate any assistance or insight on what I'm doing wrong.

            views.py

            ...

            ANSWER

            Answered 2021-Apr-26 at 22:15

            In your views.py you set status = data.Completed which creates a variable called status with the boolean value that data.Completed holds. So that means that the status variable doesn't have the attribute save.

            We need to set the completed field to True then save the data object.

            Try this:

            Source https://stackoverflow.com/questions/67274314

            QUESTION

            How do I make an M-Pesa Callback URL using Firebase Cloud Firestore?
            Asked 2020-Dec-14 at 10:59

            I'm trying to make an app that can send payments to PayBill numbers with Safaricom's "Lipa Na M-Pesa" (a Kenyan thing). The call is a POST request to URL:

            ...

            ANSWER

            Answered 2020-Dec-14 at 10:59

            Is there any way I can create a callback URL with them that will receive their callback as a document in a Firestore collection?...

            The most common way to do that in the Firebase ecosystem is to write an HTTPS Cloud Function that will be called by the Safaricom service.

            Within the Cloud Function you will be able to update the Firestore document, based on the content of the POST request.

            Something like:

            Source https://stackoverflow.com/questions/65285239

            QUESTION

            How to hold a node api execution till a db query does not return null
            Asked 2020-Oct-28 at 15:20

            Seems rather like an unwanted requirement for a piece of code but in my case this is exactly what I need. I have an api (API-1) that interacts with a third party service. This third party service instead of directly giving me a response that I can forward back to frontend is giving me response on API-2 (With a webhook listener endpoint). I'm saving this API-2 response that I get by listening to the webhook in my database. Now I somehow need this response which is now sitting idol in my database in my API-1 so that I can forward it back to the frontend. If I query the database right away during the flow of the API-1 (Just after consume the third party service API), I'll get null as API-2 is getting the response asynchronously with a webhook (Mostly a gap of 1-2 seconds). So I somehow need to figure out an easy way to await/hold the API-1 flow till the database does not return null/returns back the response I saved from API-2 in the database. I'm not sure if the gap will always be 1-2 seconds hence I can't be using setTimeout for this.

            ...

            ANSWER

            Answered 2020-Oct-28 at 14:29
            async function getNotNullResponse({conversationId}){
                const webhookResponse = await MpesaModel.findOne({conversationId});
                return webhookResponse || getNotNullResponse({conversationId});
            }
            
            //API-1
            const sendPaymentRequest = async (req, res) => {
              try {
                const payment_reponse = await axios.post(url, body, config);
                const { data } = payment_reponse;
                console.log("Payment request => ", data);
            
                //Check result i.e response from http listener
                const webhookResponse = await getNotNullResponse({
                  conversationId: data.ConversationID
                });
            
                console.log('Webhook response => ', webhookResponse); //This is not null
            
                res.status(200).json({ message: "Send money request", data });
              } catch (error) {
                console.log("Error while making a payment request", error);
                res
                  .status(400)
                  .json({ message: "Error while send payment request", error: error.data });
              }
            };
            
            
            //API-2 - This is the webhook which receives the response
            const saveWebhookB2C = async (req, res) => {
              const { Result } = req.body;
              //console.log('Mpesa webhook data received => ', Result);
            
              let saveResponse = new MpesaModel({
                ...Result,
              });
              const result = await saveResponse.save();
              console.log('B2c mpesa to kenya saved in db => ', result);
              res.status(200).send();
            };
            

            Source https://stackoverflow.com/questions/64574801

            QUESTION

            Php Json Get Keys
            Asked 2020-Aug-18 at 13:10

            I echoed this and fetched in ajax .

            ...

            ANSWER

            Answered 2020-Aug-18 at 13:10

            Using isset will accomplish your goal:

            Source https://stackoverflow.com/questions/63468070

            QUESTION

            React: How to pick the first choice of select option
            Asked 2020-Aug-07 at 15:44

            In my react app, I have a select drop-down input. However, whenever i want to maintain the 1st occurrence in my case Mpesa(maintaining as it is by not even clicking the field) of my select option during form filling after making form submission, I get an error

            mode(pin):['"" is not a valid choice.']

            The onChange is not picking that 1st occurrence unless i click another option then re-select that 1st option.

            Form component

            ...

            ANSWER

            Answered 2020-Aug-07 at 15:44

            In class use componentDidMount for setting initail value in state

            Source https://stackoverflow.com/questions/63304815

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install mpesa

            Pull in the package through Composer.
            Run composer require smodav/mpesa to get the latest stable version of the package.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link