Giter VIP home page Giter VIP logo

pypesa's Introduction

PyPesa

Python Pesa SDK

Installation

This package is available in Python Package Index and can be installed using pip

pip install pypesa

The package comprise both original open API codes and refactored codes.

To use original open API code import open_api module

from pypesa.open_api import APIContext, APIMethodType, APIRequest

To use refactored code import MPESA from vodacom module.

from pypesa.vodacom import MPESA

Features

  • Customer to Business (C2B)
  • Business to Customer (B2C)
  • Business to Business (B2B)
  • Payment Reversal
  • Transaction Status
  • Direct debit creation and Payment

Pre-requisites

The following are required and are obtained from Vodacom Open Api portal

  • Api Key
  • Public Key

See more in documentation.

Examples

Customer to Business payment via vodacom m-pesa

# vodacom M-PESA
from pypesa.vodacom import MPESA

api_key = '<your-api-key>'
public_key = '<open-api-public-key>'

m_pesa = MPESA(api_key=api_key, public_key=public_key)

# Customer to Business payment
parameters = {
    'input_Amount': '1000', # amount to be charged
    'input_Country': 'TZN',
    'input_Currency': 'TZS',
    'input_CustomerMSISDN': '000000000001',
    'input_ServiceProviderCode': '000000',
    'input_ThirdPartyConversationID': 'c9e794e10c63479992a8b08703abeea36',
    'input_TransactionReference': 'T23434ZE3',
    'input_PurchasedItemsDesc': 'Shoes',
}

response = m_pesa.customer2business(parameters)

Check more examples of methods and responses in docs

Credits

License

Code released under MIT LICENSE

pypesa's People

Contributors

alphaolomi avatar zendainnocent avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.