aiopaystack


Nameaiopaystack JSON
Version 2.0.0 PyPI version JSON
download
home_page
SummaryAsynchronous PayStack library
upload_time2023-07-13 21:39:55
maintainer
docs_urlNone
author
requires_python>=3.10
license
keywords paystack asynchronous
VCS
bugtrack_url
requirements httpx pytest pytest-asyncio
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # aiopaystack


Asynchronous Python library for [Paystack](https://paystack.com/)

![GitHub](https://img.shields.io/github/license/ichinga-samuel/aiopaystack)
![PyPI](https://img.shields.io/pypi/v/aiopaystack)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/aiopaystack)
![GitHub issues](https://img.shields.io/github/issues/ichinga-samuel/aiopaystack)
![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/ichinga-samuel/aiopaystack/master/master)
## Installation
```bash
pip install aiopaystack
```

## Usage
Add your paystack secret key as an environment variable as PAY_STACK_SECRET_KEY
```python
from paystack import Transactions

trans = Transactions()

# All parameters must be passed in as keywords. For both required and optional arguments.
res = await trans.initialize(email="sam@gmail.com", amount='5000')

# Passing secret key as an argument
# This replaces any key set in the environment
from paystack import Paystack
paystack = Paystack(secret_key="paystack_secret_key")

# to use one session for multiple request use the class as a context manager
async with Transactions() as trans:
    res= await trans.verify(reference="ref")
    
# The response type for every request is a typed dict.
from typing import TypedDict, Any
Response = TypedDict('Response', {'status_code': int, 'status': bool, 'message': str, 'data': dict | Any})

# Sample response
{'status': True,
 'message': 'Authorization URL created',
 'data': 
     {'authorization_url': 'https://checkout.paystack.com/3521i62zf1i0ljl',
      'access_code': '3521i62zf1i0ljl', 'reference': '2q16btxglw'
      },
 'status_code': 200
 }
## DOC Reference: <https://developers.paystack.co/v2.0/reference>
### Static Use
```
Don't forget to get your API key from [Paystack](https://paystack.com/) and assign to the variable `PAYSTACK_SECRET_KEY`
Please reference the **docs** folder for usage,

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "aiopaystack",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "paystack,asynchronous",
    "author": "",
    "author_email": "Ichinga Samuel <ichingasamuel@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/fd/d4/10f5f22344051a7ee4829e87ffff330db1fc057440b3fd6b8e694d96f8d0/aiopaystack-2.0.0.tar.gz",
    "platform": null,
    "description": "# aiopaystack\r\n\r\n\r\nAsynchronous Python library for [Paystack](https://paystack.com/)\r\n\r\n![GitHub](https://img.shields.io/github/license/ichinga-samuel/aiopaystack)\r\n![PyPI](https://img.shields.io/pypi/v/aiopaystack)\r\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/aiopaystack)\r\n![GitHub issues](https://img.shields.io/github/issues/ichinga-samuel/aiopaystack)\r\n![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/ichinga-samuel/aiopaystack/master/master)\r\n## Installation\r\n```bash\r\npip install aiopaystack\r\n```\r\n\r\n## Usage\r\nAdd your paystack secret key as an environment variable as PAY_STACK_SECRET_KEY\r\n```python\r\nfrom paystack import Transactions\r\n\r\ntrans = Transactions()\r\n\r\n# All parameters must be passed in as keywords. For both required and optional arguments.\r\nres = await trans.initialize(email=\"sam@gmail.com\", amount='5000')\r\n\r\n# Passing secret key as an argument\r\n# This replaces any key set in the environment\r\nfrom paystack import Paystack\r\npaystack = Paystack(secret_key=\"paystack_secret_key\")\r\n\r\n# to use one session for multiple request use the class as a context manager\r\nasync with Transactions() as trans:\r\n    res= await trans.verify(reference=\"ref\")\r\n    \r\n# The response type for every request is a typed dict.\r\nfrom typing import TypedDict, Any\r\nResponse = TypedDict('Response', {'status_code': int, 'status': bool, 'message': str, 'data': dict | Any})\r\n\r\n# Sample response\r\n{'status': True,\r\n 'message': 'Authorization URL created',\r\n 'data': \r\n     {'authorization_url': 'https://checkout.paystack.com/3521i62zf1i0ljl',\r\n      'access_code': '3521i62zf1i0ljl', 'reference': '2q16btxglw'\r\n      },\r\n 'status_code': 200\r\n }\r\n## DOC Reference: <https://developers.paystack.co/v2.0/reference>\r\n### Static Use\r\n```\r\nDon't forget to get your API key from [Paystack](https://paystack.com/) and assign to the variable `PAYSTACK_SECRET_KEY`\r\nPlease reference the **docs** folder for usage,\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Asynchronous PayStack library",
    "version": "2.0.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/Ichinga-Samuel/aiopaystack/issues",
        "Homepage": "https://github.com/Ichinga-Samuel/aiopaystack"
    },
    "split_keywords": [
        "paystack",
        "asynchronous"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7c607b674a802a65cfb70d6c2e8b497c89fd1e56fa42bbe957cf0aba40cfa616",
                "md5": "1ac137a16740344119bc94864e9e8667",
                "sha256": "3891e3184de0711c51fc8a56e641aac3819e136d496f79c78ecc731c4243503c"
            },
            "downloads": -1,
            "filename": "aiopaystack-2.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1ac137a16740344119bc94864e9e8667",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 29592,
            "upload_time": "2023-07-13T21:39:51",
            "upload_time_iso_8601": "2023-07-13T21:39:51.675279Z",
            "url": "https://files.pythonhosted.org/packages/7c/60/7b674a802a65cfb70d6c2e8b497c89fd1e56fa42bbe957cf0aba40cfa616/aiopaystack-2.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fdd410f5f22344051a7ee4829e87ffff330db1fc057440b3fd6b8e694d96f8d0",
                "md5": "ad46be5929b48cfeab7d965ddbb029a3",
                "sha256": "2b001997a630964c489a90afa98c4719531e61063700a7d21958489485e36994"
            },
            "downloads": -1,
            "filename": "aiopaystack-2.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ad46be5929b48cfeab7d965ddbb029a3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 21166,
            "upload_time": "2023-07-13T21:39:55",
            "upload_time_iso_8601": "2023-07-13T21:39:55.418747Z",
            "url": "https://files.pythonhosted.org/packages/fd/d4/10f5f22344051a7ee4829e87ffff330db1fc057440b3fd6b8e694d96f8d0/aiopaystack-2.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-13 21:39:55",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Ichinga-Samuel",
    "github_project": "aiopaystack",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "httpx",
            "specs": [
                [
                    "==",
                    "0.23.0"
                ]
            ]
        },
        {
            "name": "pytest",
            "specs": [
                [
                    "==",
                    "7.1.3"
                ]
            ]
        },
        {
            "name": "pytest-asyncio",
            "specs": [
                [
                    "==",
                    "0.19.0"
                ]
            ]
        }
    ],
    "lcname": "aiopaystack"
}
        
Elapsed time: 0.18674s