No project description provided
Project description
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 payment import Pay
# Initialize payment
email = "customer@email.com"
amount = "20000"
secret_key = "sk_test_6215942a0765956d18f05e4f52a12a6a8902cee2"
new_payment = Pay(email, amount, secret_key)
transaction_data = new_payment.initialize_transaction()
print(transaction_data)
# Sample output:
# {'status': True, 'message': 'Authorization URL created', 'data': {'authorization_url': 'https://checkout.paystack.com/1hxv7un'}}
3. Subscription
from 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. Webhook
from 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pypstk-0.0.1.tar.gz
(3.9 kB
view hashes)
Built Distribution
pypstk-0.0.1-py3-none-any.whl
(5.2 kB
view hashes)