Metadata-Version: 2.1
Name: payfast-client
Version: 0.1.2
Summary: Python client for interacting with the Payfast API
Home-page: https://github.com/fergusdixon/payfast-python-client
License: MIT
Keywords: payfast
Author: Fergus Strangways-Dixon
Author-email: fergusdixon101@gmail.com
Requires-Python: >=3.7,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: pytz (>=2021.1,<2022.0)
Requires-Dist: requests-futures (>=1.0.0,<2.0.0)
Project-URL: Repository, https://github.com/fergusdixon/payfast-python-client
Description-Content-Type: text/markdown

# payfast-python-client

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/0a0a2acf5df045ceb533c8ee953d23a2)](https://app.codacy.com/gh/fergusdixon/payfast-python-client?utm_source=github.com&utm_medium=referral&utm_content=fergusdixon/payfast-python-client&utm_campaign=Badge_Grade)

Asynchronous Python Client for the [Payfast API](https://developers.payfast.co.za/api)

Uses [requests-futures](https://github.com/ross/requests-futures)

## Installation
Available on [PyPi](https://pypi.org/project/payfast-client/)
```shell
pip install payfast-client
```

## Usage
 ```python
from payfast_client import PayfastClient
client = PayfastClient(merchant_id=123, merchant_passphrase="passphrase")
subscription = client.fetch_subscription(token="abc")
print(subscription)
```
```
<Future at 0x107d88520 state=finished returned Response>
```
```python
print(subscription.result())
```
```
<Response [200]>
```

## Features
- [x] Signature Generation
- [ ] Error Handling (Sometimes errors returned with response_code=200)
- Endpoints
    - [x] GET /ping
    - Recurring Billing
        - [x] GET   /subscriptions/:token/fetch
        - [x] PUT   /subscriptions/:token/pause
        - [x] PUT   /subscriptions/:token/unpause
        - [x] PUT   /subscriptions/:token/cancel
        - [x] PATCH /subscriptions/:token/update
        - [ ] POST  /subscriptions/:token/adhoc
    - Transaction History
        - [ ] GET   /transactions/history
        - [ ] GET   /transactions/history/daily
        - [ ] GET   /transactions/history/weekly
        - [ ] GET   /transactions/history/monthly
    - Credit card transaction query
        - [ ] GET   /process/query/:id

