{ "info": { "author": "Mawuli Adzaku", "author_email": "mawuli@mawuli.me", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Utilities" ], "description": ".. image:: https://api.travis-ci.org/mawuli/mpower-python.png\n\nMPower Python Client Library\n============================\n\nThis is a Python library for accessing the MPower Payments HTTP API.\n\nInstallation\n------------\n\n.. code-block:: bash\n\n $ sudo pip install mpower\n $ OR git clone https://github.com/mawuli/mpower-python\n $ cd mpower-python; python setup.py install`\n $ nosetests tests/ # run unit tests\n\nUsage\n-----\n\n.. code-block:: python\n\n import mpower\n from mpower import InvoiceItem, Store\n\n # runtime configs\n MP_ACCESS_TOKENS = {\n 'MP-Master-Key': \"Your MPower master key\",\n 'MP-Private-Key': \"Your MPower private key\",\n 'MP-Token': \"Your MPower token\"\n }\n # defaults to False\n mpower.debug = True\n # set the access/api keys\n mpower.api_keys = MP_ACCESS_TOKENS\n\n # Invoice\n store = Store(name='FooBar Shop')\n items = [\n InvoiceItem(\n name=\"VIP Ticket\",\n quantity=2,\n unit_price=\"35.0\",\n total_price=\"70.0\",\n description=\"VIP Tickets for the MPower Event\"\n },\n InvoiceItem(\n name=\"Shoe\",\n quantity=1,\n unit_price=\"75.99\",\n total_price=\"80.99\",\n description=\"Black shoe for men\"\n },\n ]\n invoice = mpower.Invoice(store)\n invoice.add_items(items)\n # taxes are (key,value) pairs\n invoice.add_taxes([(\"NHIS TAX\", 23.8), (\"VAT\", 5)])\n invoice.add_custom_data([\n (\"phone_brand\", \"Motorola V3\"),\n (\"model\", \"65456AH23\"),\n ])\n\n # you can also pass the items, taxes, custom to the `create` method\n successful, response = invoice.create()\n if successful:\n do_something_with_resp(response)\n\n # confirm invoice\n invoice.confirm(response['token'])\n\n\n # OPR\n opr_data = {\n 'account_alias': '02XXXXXXXX',\n 'description': 'Hello World',\n 'total_amount': 345\n }\n store = mpower.Store(name='FooBar Shop')\n opr = mpower.OPR(opr_data, store)\n # You can also pass the data to the `create` function\n successful, response = opr.create()\n if successful:\n do_something_with_response(response)\n status, _ = opr.charge({\n 'token': token,\n 'confirm_token': user_submitted_token\n })\n\n\n # Direct card\n card_info = {\n \"card_name\" : \"Alfred Robert Rowe\",\n \"card_number\" : \"4242424242424242\",\n \"card_cvc\" : \"123\",\n \"exp_month\" : \"06\",\n \"exp_year\" : \"2010\",\n \"amount\" : \"300\"\n }\n direct_card = mpower.DirectCard(card_info)\n # this request should fail since the card_info data is invalid\n successful, response = direct_card.process()\n\n\n # Direct Pay\n account_alias = \"02XXXXXXXX\"\n amount = 30.50\n # toggle debug switch to True\n direct_pay = mpower.DirectPay(account_alias, amount)\n status, response = direct_pay.process()\n\n\nLicense\n-------\nsee LICENSE.txt\n\n\nContributing\n------------\nIssues, forks, and pull requests are welcome!\n\n\nNote\n----\n- Some of the API calls require formal approval from MPower Payments\n- For more information, please read the `MPower Payments HTTP API`_\n- Tested on Python 2.6, 2.7, and 3+. `Build Status`_\n\n.. _MPower Payments HTTP API: http://mpowerpayments.com/developers/docs/http.html\n.. _Build Status: https://api.travis-ci.org/mawuli/mpower-python.png\n\nAuthors\n--------\nMawuli Adzaku ", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mawuli/mpower-python", "keywords": "mpower mobile money payments", "license": "LICENSE.txt", "maintainer": null, "maintainer_email": null, "name": "mpower", "package_url": "https://pypi.org/project/mpower/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/mpower/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/mawuli/mpower-python" }, "release_url": "https://pypi.org/project/mpower/0.1.2/", "requires_dist": null, "requires_python": null, "summary": "MPower Payments Python client library", "version": "0.1.2" }, "last_serial": 1618029, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "121050045bf53b9703bef1bb3d7c60fe", "sha256": "29c226a7ae7a1a66e53fe43703436891330eb3bbfc9d113b90089b4fb779f45d" }, "downloads": -1, "filename": "mpower-0.1.0.tar.gz", "has_sig": true, "md5_digest": "121050045bf53b9703bef1bb3d7c60fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 146565, "upload_time": "2013-11-21T17:17:25", "url": "https://files.pythonhosted.org/packages/c8/b1/50dbeaa7fa4afd1b3833d4bcf59e267de80c606cc1977145a1d145862980/mpower-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "593d3c907d630a13336667a1fdd5e215", "sha256": "e6702ddbc33f5c4880353202987cb46461281bc80f008d5d746cf6a6e827f922" }, "downloads": -1, "filename": "mpower-0.1.1.tar.gz", "has_sig": false, "md5_digest": "593d3c907d630a13336667a1fdd5e215", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 145257, "upload_time": "2015-04-18T14:06:23", "url": "https://files.pythonhosted.org/packages/b8/78/2e80d6ccd77c4a10dd7121ec0c2462e92de77a0fbaae6402dd7515670da3/mpower-0.1.1.tar.gz" } ], "0.1.2": [] }, "urls": [] }