paystackease


Namepaystackease JSON
Version 2.0.4 PyPI version JSON
download
home_pageNone
SummaryThis is a simple api wrapper that implements both asynchronous and synchronous http requests to interact with Paystack APIs.
upload_time2024-05-01 16:47:31
maintainerNone
docs_urlNone
authorPeter Mbachu
requires_python<4.0,>=3.9
licenseMIT
keywords paystack paystackease python api payment integration
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PayStackEase Library  

--------------

![Python Versions](https://img.shields.io/badge/python-3.9|3.10|3.11|3.12-blue) ![License](https://img.shields.io/pypi/l/paystackease.svg) ![pypi](https://img.shields.io/pypi/v/paystackease.svg)


**PayStackEase API Library**  is a Python library that simplifies interacting with the Paystack API. 
It provides both asynchronous and synchronous wrappers for various Paystack functionalities, 
making it easier to integrate payment processing into your Python projects.

> 📝: Read more on paystack api documentation: [Paystack API DOCUMENTATION](https://paystack.com/docs/api/)

> 📝: Read more on paystackease api documentation: [PayStackEase DOCUMENTATION](https://paystackease.readthedocs.io/en/latest/)


## Getting Started

You should create a Paystack account to generate a **Paystack Secret Key**. You can see this in the *settings page >> API keys and Webhook section*.

> ⚠️: **Warning:** Do not expose your secret key or commit your secret key to git, or use them in client-side code.

> 💡: **Take Note:**  Public key is to be used from your front-end when integrating using Paystack Inline. In this case you have to use you secret key

> ✅: **Good**: Set your secret key in environment variables as seen: *PAYSTACK_SECRET_KEY=your-secret-key*


## Create a Virtual Environment

1. For Windows:

    * Create virtual environment

        ```
            py -m venv <environment_name>
       ```
    * Activate the virtual environment

        ```
            <environment_name>\Scripts\activate
       ```

2. For Unix/macOS

    * Create virtual environment

        ```
            python3 -m venv <environment_name>
       ```
    * Activate the virtual environment

        ```
            <environment_name>/bin/activate
       ```

----------------------------------------------------------------------

## Install paystackease library:


* #### Install paystackease using pip.

> pip install paystackease

* #### Install paystackease using pipx.

> pipx install paystackease

* #### Install paystackease using poetry.

> poetry add paystackease


## If you want to download the sdist packages directly:

Download the wheel distribution file and install using pip

>  pip install paystackease-2.0.0-py3-none-any.whl 

Download the source distribution file, and install using pip

> pip install paystackease-2.0.0.tar.gz 


## To get a development version of paystackease

Clone from the ``dev`` branch GitHub repository, unzip and install:

> git clone -b dev https://github.com/cla-bit/PayStackEase.git

> cd PayStackEase

> pip install paystackease

----------------------------------------------------------------------

## API usage

-------------------------------------------------------

### Making a Transaction [Synchronous]

If after setting your secret key in environment variables, for a synchronous transaction process 
all you need to do is use the transaction API to make a transaction. 

To create a transaction or initialize a transaction:

* import the Paystack API wrapper.

```apacheconf
    from paystackease import PayStackBase
```

* Create an instance to use the PaystackBase wrapper to interact with the Transaction API.

```apacheconf
    paystack_client = PayStackBase()
```

* Use the instance and call the transaction method to initialize a transaction

```apacheconf
    create_transaction = paystack_client.transactions.initialize(
        email="johndoe@email.com",
        amount=10000000)
    
    print(f"Transaction Created: {create_transaction}")
```

> ✅: **Good**: You can check your Paystack account, go to the Transaction page, and you will see the transaction just created.


# Other Tools
Similar to calling the PayStackBase, you can also call other tools to make your work easy. For example:

* ### Account Type
```apacheconf
    from paystackease import AccountType
    
    val1 = AccountType.PERSONAL.value
    
    print(val1)
```
> "personal"

* ### Convert units to subunits:
```apacheconf
    from paystackease import convert_to_subunit
    
    # amount should be in subunit in this case 10000 kobo = 100 naira
    money = convert_to_subunit(100, Currency.NGN)
    print(money)
```
> 10000

* ### Channels
```apacheconf
    from paystackease import Channels
    
    bank = Channels.BANK.value
    
    print(bank)
```
> "bank"

* ### Currency
```apacheconf
    from paystackease import Currency
    
    val1 = Currency.NGN.value
    
    print(val1)
```
> "NGN"

* ### Document Type
```apacheconf
    from paystackease import DocumentType
    
    val1 = DocumentType.IDENTITY_NUMBER.value
    
    print(val1)
```

> "identityNumber"

Others are: ***EventType, Interval, MobileMoney, PWT, QRCODE, RecipientType, ResendOTP, Resolution, RiskAction, SplitType, STATUS, etc***.


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "paystackease",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "paystack, paystackease, python, api, payment integration",
    "author": "Peter Mbachu",
    "author_email": "doublep098@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/05/ad/bb6756ef4bc40ffad43774272400bd13466eaa25b03611cb90a8e1800686/paystackease-2.0.4.tar.gz",
    "platform": null,
    "description": "# PayStackEase Library  \n\n--------------\n\n![Python Versions](https://img.shields.io/badge/python-3.9|3.10|3.11|3.12-blue) ![License](https://img.shields.io/pypi/l/paystackease.svg) ![pypi](https://img.shields.io/pypi/v/paystackease.svg)\n\n\n**PayStackEase API Library**  is a Python library that simplifies interacting with the Paystack API. \nIt provides both asynchronous and synchronous wrappers for various Paystack functionalities, \nmaking it easier to integrate payment processing into your Python projects.\n\n> \ud83d\udcdd: Read more on paystack api documentation: [Paystack API DOCUMENTATION](https://paystack.com/docs/api/)\n\n> \ud83d\udcdd: Read more on paystackease api documentation: [PayStackEase DOCUMENTATION](https://paystackease.readthedocs.io/en/latest/)\n\n\n## Getting Started\n\nYou should create a Paystack account to generate a **Paystack Secret Key**. You can see this in the *settings page >> API keys and Webhook section*.\n\n> \u26a0\ufe0f: **Warning:** Do not expose your secret key or commit your secret key to git, or use them in client-side code.\n\n> \ud83d\udca1: **Take Note:**  Public key is to be used from your front-end when integrating using Paystack Inline. In this case you have to use you secret key\n\n> \u2705: **Good**: Set your secret key in environment variables as seen: *PAYSTACK_SECRET_KEY=your-secret-key*\n\n\n## Create a Virtual Environment\n\n1. For Windows:\n\n    * Create virtual environment\n\n        ```\n            py -m venv <environment_name>\n       ```\n    * Activate the virtual environment\n\n        ```\n            <environment_name>\\Scripts\\activate\n       ```\n\n2. For Unix/macOS\n\n    * Create virtual environment\n\n        ```\n            python3 -m venv <environment_name>\n       ```\n    * Activate the virtual environment\n\n        ```\n            <environment_name>/bin/activate\n       ```\n\n----------------------------------------------------------------------\n\n## Install paystackease library:\n\n\n* #### Install paystackease using pip.\n\n> pip install paystackease\n\n* #### Install paystackease using pipx.\n\n> pipx install paystackease\n\n* #### Install paystackease using poetry.\n\n> poetry add paystackease\n\n\n## If you want to download the sdist packages directly:\n\nDownload the wheel distribution file and install using pip\n\n>  pip install paystackease-2.0.0-py3-none-any.whl \n\nDownload the source distribution file, and install using pip\n\n> pip install paystackease-2.0.0.tar.gz \n\n\n## To get a development version of paystackease\n\nClone from the ``dev`` branch GitHub repository, unzip and install:\n\n> git clone -b dev https://github.com/cla-bit/PayStackEase.git\n\n> cd PayStackEase\n\n> pip install paystackease\n\n----------------------------------------------------------------------\n\n## API usage\n\n-------------------------------------------------------\n\n### Making a Transaction [Synchronous]\n\nIf after setting your secret key in environment variables, for a synchronous transaction process \nall you need to do is use the transaction API to make a transaction. \n\nTo create a transaction or initialize a transaction:\n\n* import the Paystack API wrapper.\n\n```apacheconf\n    from paystackease import PayStackBase\n```\n\n* Create an instance to use the PaystackBase wrapper to interact with the Transaction API.\n\n```apacheconf\n    paystack_client = PayStackBase()\n```\n\n* Use the instance and call the transaction method to initialize a transaction\n\n```apacheconf\n    create_transaction = paystack_client.transactions.initialize(\n        email=\"johndoe@email.com\",\n        amount=10000000)\n    \n    print(f\"Transaction Created: {create_transaction}\")\n```\n\n> \u2705: **Good**: You can check your Paystack account, go to the Transaction page, and you will see the transaction just created.\n\n\n# Other Tools\nSimilar to calling the PayStackBase, you can also call other tools to make your work easy. For example:\n\n* ### Account Type\n```apacheconf\n    from paystackease import AccountType\n    \n    val1 = AccountType.PERSONAL.value\n    \n    print(val1)\n```\n> \"personal\"\n\n* ### Convert units to subunits:\n```apacheconf\n    from paystackease import convert_to_subunit\n    \n    # amount should be in subunit in this case 10000 kobo = 100 naira\n    money = convert_to_subunit(100, Currency.NGN)\n    print(money)\n```\n> 10000\n\n* ### Channels\n```apacheconf\n    from paystackease import Channels\n    \n    bank = Channels.BANK.value\n    \n    print(bank)\n```\n> \"bank\"\n\n* ### Currency\n```apacheconf\n    from paystackease import Currency\n    \n    val1 = Currency.NGN.value\n    \n    print(val1)\n```\n> \"NGN\"\n\n* ### Document Type\n```apacheconf\n    from paystackease import DocumentType\n    \n    val1 = DocumentType.IDENTITY_NUMBER.value\n    \n    print(val1)\n```\n\n> \"identityNumber\"\n\nOthers are: ***EventType, Interval, MobileMoney, PWT, QRCODE, RecipientType, ResendOTP, Resolution, RiskAction, SplitType, STATUS, etc***.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "This is a simple api wrapper that implements both asynchronous and synchronous http requests to interact with Paystack APIs.",
    "version": "2.0.4",
    "project_urls": {
        "Bug Tracker": "https://github.com/cla-bit/PayStackEase/issues",
        "Documentation": "https://paystackease.readthedocs.io/en/latest/",
        "Homepage": "https://github.com/cla-bit/PayStackEase",
        "Source Code": "https://github.com/cla-bit/PayStackEase"
    },
    "split_keywords": [
        "paystack",
        " paystackease",
        " python",
        " api",
        " payment integration"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "348849e45e20a479cbab20588c24adf262f0a1a474de6489b47910670e6e06d3",
                "md5": "2a76f33652c6e5a68c0bcc0805d6847b",
                "sha256": "c3e636281fdb8ea7cedd0a8a7ea7638857656efa0157bbc98d50727a03a390cd"
            },
            "downloads": -1,
            "filename": "paystackease-2.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2a76f33652c6e5a68c0bcc0805d6847b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 78917,
            "upload_time": "2024-05-01T16:47:30",
            "upload_time_iso_8601": "2024-05-01T16:47:30.268239Z",
            "url": "https://files.pythonhosted.org/packages/34/88/49e45e20a479cbab20588c24adf262f0a1a474de6489b47910670e6e06d3/paystackease-2.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "05adbb6756ef4bc40ffad43774272400bd13466eaa25b03611cb90a8e1800686",
                "md5": "67cf3dabfae9e92063e7a0d1ce6fda09",
                "sha256": "90b591a0227d50217fbacc4777832f873fb5b229e2e0280b9e32b55c9ca6bdd0"
            },
            "downloads": -1,
            "filename": "paystackease-2.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "67cf3dabfae9e92063e7a0d1ce6fda09",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 44787,
            "upload_time": "2024-05-01T16:47:31",
            "upload_time_iso_8601": "2024-05-01T16:47:31.499112Z",
            "url": "https://files.pythonhosted.org/packages/05/ad/bb6756ef4bc40ffad43774272400bd13466eaa25b03611cb90a8e1800686/paystackease-2.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-01 16:47:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cla-bit",
    "github_project": "PayStackEase",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "paystackease"
}
        
Elapsed time: 0.34154s