Skip to content

hawkinswinja/lipa_fees

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lipa Fees

Description

Lipa fees is an instruction driven WhatsApp Chatbot that allows students to conveniently pay their fees to institutions using M-PESA, a mobile money service. Users replace the UPPER texts with actual values and after confirming pay, an STK push is initiated directly to their phones.

This is a prototype version which uses M-PESA's simulation sandbox to push prompts and should therefore not be used to make actual payments

sample chat

Table of Contents

Installation

  1. Clone this repository
git clone https://github.com/hawkinswinja/lipa_fees.git
  1. Navigate to the project directory:
cd lipa_fees
  1. Install requirements:
pip install -r requirements.txt
  1. Set up environment variables
    • Register accounts on twilio and M-PESA API
    • Set the app's secret key under the environment variable SK
    • Set up environment variables CS and CK using values from Daraja App's Consumer and Secret Key
    • Set up environment variables ACCOUNT_SID and AUTH_TOKEN using credentials from Twilio account
    • Replace the variable pk in chatbot.py with your daraja App's passkey
  2. Run the command
flask --app chatbot run
  1. Install Ngrok and expose the application
ngrok http 5000
  1. Update the status url of your sandbox settings in Twilio and the CallBackURL key of variable payload inside the chatbot.py to match your public url provided by Ngrok.

Usage

  1. Open WhatsApp and text your sandbox code to the number of your Twilio account eg.
    • Text join birds-year to +1 (415) 523-8886 for this project's test.
  2. Initiate payment by texting /start
  3. Reply as instructed by the chatbot's prompt replacing all the text in upper case with real values.

Contributing

Contributions are welcome! To contribute to this project, please follow these steps:

  1. Fork the repository.
  2. Create a new branch: git checkout -b feature/your-feature.
  3. Make your changes and commit them: git commit -m 'Add some feature'.
  4. Push to the branch: git push origin feature/your-feature.
  5. Open a pull request.

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages