Skip to main content

Mpesa payment gateway

Project description

Mpesa Payment Lib

An Mpesa payment library for django framework

Getting Started Guide

Project description

This is a simple payment library to help you implement Mpesa payment in your dango application.

It's give all the required utility functions and methods to seamlessly work with mpesa

Installation

It's very simple to install. Use:

pip install dj-mpesa-payment or pipenv install dj-mpesa-payment when using pip and pipenv respectively

Setup

In your project's top level setting.py file, define the following mandatory variable;

  • MPESA_CONSUMER_KEY = consumer_key

    • This is a consumer key from daraja developers account
  • MPESA_CONSUMER_SECRET = secret_key

    • This key is also obtained from daraja developers account
  • MPESA_BASE_URL = mpesa_api_base_url

  • CONFIRMATION_CALL_BACK_URL = your_confirm_url_endpoint

    • This is a POST endpoint in your project that Safaricom will be sending the payment confirmation data successful payments
  • VALIDATION_CALL_BACK_URL = your_validation_url_endpoint.

    • Not yet implemented. Read more on daraja api documentation
  • PASS_KEY = pass_key

    • This key is as well obtained from daraja developers account
  • SHORT_CODE = your_paybill_or_till_number

  • ACCOUNT_REFERENCE = your_organisation_name

    • This is your organisation's name
  • TRANSACTION_DESCRIPTION = transaction_description

    • This is a short text describing to user when the stk push pops what this transaction is for

Also, add in your setting.py, add the app in the INSTALLED_APP as

INSTALLED_APPS = [
  #Other apps
  'mpayments',
]

Usage

Coming Soon.

For guidance, contact the Author

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dj-mpesa-payment-0.0.2.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dj_mpesa_payment-0.0.2-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file dj-mpesa-payment-0.0.2.tar.gz.

File metadata

  • Download URL: dj-mpesa-payment-0.0.2.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for dj-mpesa-payment-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c4321e2da57bd8e18e630917fb6c5a32aceccd1a8116d7162b697e16bae23389
MD5 278813d8a1b0afebf042430eda6d6770
BLAKE2b-256 e638ed1942dcaf1a511f78b24326e8fbc346a3a1ab0a4908eced845589533c82

See more details on using hashes here.

File details

Details for the file dj_mpesa_payment-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for dj_mpesa_payment-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 08857fda7504a03ec976f3d5370431eccc133ec253175734502ef8f10f5a51d4
MD5 9623b2c8b47b13adae77dd501617c2c3
BLAKE2b-256 80f3ec5b009fbf98e0ee5057309eb04fa7344d25edf64fd3c62cbf33548a991c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page