semvec/pypi-packages huggingface dataset:
qosic 0.1.2
An unofficial python sdk for the QosIc platform.
License: MIT license
Requires Python: >=3.7
Keywords: qosic

=========
qosic-sdk
=========


.. image:: https://img.shields.io/pypi/v/qosic.svg
        :target: https://pypi.python.org/pypi/qosic

.. image:: https://api.travis-ci.com/Tobi-De/qosic-sdk.svg
        :target: https://travis-ci.com/Tobi-De/qosic-sdk

.. image:: https://readthedocs.org/projects/qosic-sdk/badge/?version=latest
        :target: https://qosic-sdk.readthedocs.io/en/latest/?version=latest
        :alt: Documentation Status




An unofficial python sdk for the QosIC_ platform. This platform provides an api to enable mobile
money payments for businesses in Africa.


* Free software: MIT license
* Documentation: https://qosic-sdk.readthedocs.io.

Supported Python versions
-------------------------

This library was tested with the following Python implementations, but it should work for all python 3.7 and above.

- Python 3.7
- Python 3.8


Features
--------

- Simple synchronous client to make your payment requests
- Clean and meaningful exceptions

TODOS
-----

- Async Client for payment requests
- Configurable timeouts
- Enable Debug Logging
- 100 % test coverage


Quickstart
----------

For those of you in a hurry, here's a sample code to get you started.

.. code-block:: python3

    from qosic import Client, Provider, State
    from qosic.exceptions import InvalidCredentialsError, RequestError
    from dotenv import dotenv_values

    config = dotenv_values(".env")

    moov_client_id = config.get("MTN_CLIENT_ID")
    mtn_client_id = config.get("MOOV_CLIENT_ID")
    server_login = config.get("SERVER_LOGIN")
    server_pass = config.get("SERVER_PASS")
    # This is just for test purpose, you should directly pass the phone number
    phone = config.get("PHONE_NUMBER")


    def main():
        providers = [
            Provider(name="MTN", client_id=mtn_client_id),
            Provider(name="MOOV", client_id=moov_client_id),
        ]
        try:
            client = Client(providers=providers, login=server_login, password=server_pass)
            result = client.request_payment(phone=phone, amount=2000)
        except (InvalidCredentialsError, RequestError) as e:
            print(e)
        else:
            if result.state == State.CONFIRMED:
                print(
                    f"TransRef: {result.trans_ref} : Your requested payment to {result.phone}  for an amount "
                    f"of {result.amount} has been successfully validated "
                )


    if __name__ == "__main__":
        main()


Credits
-------

This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
.. _QosIC: https://www.qosic.com/


=======
History
=======

0.1.0 (2021-05-12)
------------------

* First release on PyPI.