Pystack
This Python package provides a set of classes to interact with the Paystack API for handling transactions, customers, subscriptions, and webhooks.
Installation
To use this package, you need to have Python installed. You can install the package using pip:
pip install pypstk
Usage
1. Payment
from pypstk.payment import Payment
email = "customer@email.com"
amount = "20000"
secret_key = "your secret_key from api"
new_payment = Payment(email, amount, secret_key)
transaction_data = new_payment.initialize_transaction()
print(transaction_data)
# Sample output:
# {'references': '8pr6trcjj5', 'url': 'https://checkout.paystack.com/j62hay03a7dj6iu'}
3. Subscription
from pypstk.subscription import Subscription
# Initialize subscription payment
name = "Monthly Retainer"
interval = "monthly"
amount = 500000
secret_key = "sk_test_daf386e7071c4613e54e4b71f43926409abd811e"
pay_subscription = Subscription(name, interval, amount, secret_key)
pay_subscription.initialize_payment()
pay_subscription.payment_status()
4. Payment Status
from pypstk.status import Verify
# Check webhook status
reference = "YOUR_REFERENCE"
secret_key = "YOUR_SECRET_KEY"
hook = Hook(reference, secret_key)
status = hook.status()
print(status)
Contributors
- Emekadefirst
- I used Olabode template to test this in an api
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for pypstk 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pypstk-0.2.0.tar.gz | 3.8 kB | Without provenance | Details for pypstk-0.2.0.tar.gz |
Release files / pypstk-0.2.0.tar.gz
| Download URL | pypstk-0.2.0.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6abfa384c78d0027bcf3633279149f7f3864ef4d241e5a84b6a93a7052051e3c
|
|
BLAKE2b-256 checksum How to use checksums |
dc381a8bd5dd2cc84fbf433c622dbe4f668a3217de8636dbc39f50ead29c740e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.2
|
Security for pypstk 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.