pypaystack2 2.1.0__tar.gz → 3.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pypaystack2-3.0.0/.github/workflows/documentation-release.yml +32 -0
- pypaystack2-3.0.0/.github/workflows/publish.yml +25 -0
- {pypaystack2-2.1.0 → pypaystack2-3.0.0}/.github/workflows/python-package.yml +13 -15
- pypaystack2-3.0.0/.pre-commit-config.yaml +19 -0
- pypaystack2-3.0.0/.python-version +1 -0
- {pypaystack2-2.1.0 → pypaystack2-3.0.0}/CHANGELOG.md +57 -10
- pypaystack2-3.0.0/PKG-INFO +164 -0
- pypaystack2-3.0.0/README.md +148 -0
- pypaystack2-3.0.0/docs/assets/illustration-0.png +0 -0
- pypaystack2-3.0.0/docs/assets/illustration-1.png +0 -0
- pypaystack2-3.0.0/docs/how-to-guides.md +3 -0
- pypaystack2-3.0.0/docs/index.md +405 -0
- pypaystack2-3.0.0/docs/reference/apple_pay.md +2 -0
- pypaystack2-3.0.0/docs/reference/bulk_charges.md +2 -0
- pypaystack2-3.0.0/docs/reference/charge.md +2 -0
- pypaystack2-3.0.0/docs/reference/customer.md +2 -0
- pypaystack2-3.0.0/docs/reference/dedicated_accounts.md +2 -0
- pypaystack2-3.0.0/docs/reference/disputes.md +2 -0
- {pypaystack2-2.1.0 → pypaystack2-3.0.0}/docs/reference/index.md +7 -11
- pypaystack2-3.0.0/docs/reference/integration.md +2 -0
- pypaystack2-3.0.0/docs/reference/miscellaneous.md +2 -0
- pypaystack2-3.0.0/docs/reference/payment_pages.md +2 -0
- pypaystack2-3.0.0/docs/reference/payment_requests.md +2 -0
- pypaystack2-3.0.0/docs/reference/plans.md +2 -0
- pypaystack2-3.0.0/docs/reference/products.md +2 -0
- pypaystack2-3.0.0/docs/reference/refunds.md +2 -0
- pypaystack2-3.0.0/docs/reference/settlements.md +2 -0
- pypaystack2-3.0.0/docs/reference/splits.md +2 -0
- pypaystack2-3.0.0/docs/reference/subaccounts.md +2 -0
- pypaystack2-3.0.0/docs/reference/subscriptions.md +2 -0
- pypaystack2-3.0.0/docs/reference/terminals.md +2 -0
- pypaystack2-3.0.0/docs/reference/transactions.md +2 -0
- pypaystack2-3.0.0/docs/reference/transfer_recipients.md +2 -0
- pypaystack2-3.0.0/docs/reference/transfers.md +2 -0
- pypaystack2-3.0.0/docs/reference/transfers_control.md +2 -0
- pypaystack2-3.0.0/docs/reference/verification.md +2 -0
- pypaystack2-3.0.0/docs/tutorials/tutorial-00.md +474 -0
- {pypaystack2-2.1.0 → pypaystack2-3.0.0}/mkdocs.yml +29 -6
- {pypaystack2-2.1.0 → pypaystack2-3.0.0}/pyproject.toml +18 -3
- pypaystack2-3.0.0/src/pypaystack2/__init__.py +58 -0
- {pypaystack2-2.1.0 → pypaystack2-3.0.0}/src/pypaystack2/_metadata.py +2 -2
- pypaystack2-3.0.0/src/pypaystack2/base_clients.py +353 -0
- {pypaystack2-2.1.0/src/pypaystack2/utils → pypaystack2-3.0.0/src/pypaystack2}/enums.py +45 -36
- pypaystack2-3.0.0/src/pypaystack2/exceptions.py +14 -0
- pypaystack2-3.0.0/src/pypaystack2/fees_calculation_mixin.py +350 -0
- pypaystack2-3.0.0/src/pypaystack2/main_clients.py +245 -0
- pypaystack2-3.0.0/src/pypaystack2/models/__init__.py +171 -0
- pypaystack2-3.0.0/src/pypaystack2/models/payload_models.py +181 -0
- pypaystack2-3.0.0/src/pypaystack2/models/response_models.py +850 -0
- pypaystack2-2.1.0/tests/__init__.py → pypaystack2-3.0.0/src/pypaystack2/py.typed +0 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/__init__.py +102 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/async_clients/__init__.py +59 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/async_clients/apple_pay.py +143 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/async_clients/bulk_charges.py +257 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/async_clients/charge.py +320 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/async_clients/customers.py +367 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/async_clients/dedicated_accounts.py +467 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/async_clients/disputes.py +382 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/async_clients/integration.py +80 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/async_clients/miscellaneous.py +150 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/async_clients/payment_pages.py +288 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/async_clients/payment_requests.py +438 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/async_clients/plans.py +236 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/async_clients/products.py +231 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/async_clients/refunds.py +159 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/async_clients/settlements.py +116 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/async_clients/splits.py +300 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/async_clients/subaccounts.py +251 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/async_clients/subscriptions.py +301 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/async_clients/terminals.py +343 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/async_clients/transactions.py +556 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/async_clients/transfer_recipients.py +295 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/async_clients/transfers.py +274 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/async_clients/transfers_control.py +228 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/async_clients/verification.py +155 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/sync_clients/__init__.py +55 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/sync_clients/apple_pay.py +148 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/sync_clients/bulk_charges.py +257 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/sync_clients/charge.py +320 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/sync_clients/customers.py +366 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/sync_clients/dedicated_accounts.py +467 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/sync_clients/disputes.py +385 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/sync_clients/integration.py +80 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/sync_clients/miscellaneous.py +150 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/sync_clients/payment_pages.py +288 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/sync_clients/payment_requests.py +439 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/sync_clients/plans.py +236 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/sync_clients/products.py +231 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/sync_clients/refunds.py +159 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/sync_clients/settlements.py +115 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/sync_clients/splits.py +301 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/sync_clients/subaccounts.py +251 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/sync_clients/subscriptions.py +301 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/sync_clients/terminals.py +342 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/sync_clients/transactions.py +558 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/sync_clients/transfer_recipients.py +298 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/sync_clients/transfers.py +275 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/sync_clients/transfers_control.py +228 -0
- pypaystack2-3.0.0/src/pypaystack2/sub_clients/sync_clients/verification.py +155 -0
- pypaystack2-3.0.0/src/pypaystack2/types.py +13 -0
- {pypaystack2-2.1.0/tests/test_api → pypaystack2-3.0.0/tests}/__init__.py +0 -0
- {pypaystack2-2.1.0 → pypaystack2-3.0.0}/tests/test__metadata.py +6 -5
- {pypaystack2-2.1.0 → pypaystack2-3.0.0}/tests/test_baseapi.py +61 -41
- pypaystack2-3.0.0/tests/test_paystack.py +191 -0
- pypaystack2-3.0.0/tests/test_paystack_fees_calculation.py +116 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_async_clients/test_apple_pay.py +77 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_async_clients/test_bulk_charges.py +79 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_async_clients/test_charge.py +76 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_async_clients/test_customers.py +93 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_async_clients/test_dedicated_accounts.py +47 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_async_clients/test_disputes.py +50 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_async_clients/test_integration.py +37 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_async_clients/test_miscellaneous.py +46 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_async_clients/test_payment_pages.py +74 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_async_clients/test_payment_requests.py +105 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_async_clients/test_plans.py +53 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_async_clients/test_products.py +58 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_async_clients/test_refunds.py +40 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_async_clients/test_settlements.py +30 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_async_clients/test_splits.py +81 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_async_clients/test_subaccounts.py +55 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_async_clients/test_subscriptions.py +88 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_async_clients/test_terminals.py +39 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_async_clients/test_transactions.py +103 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_async_clients/test_transfer_recipients.py +98 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_async_clients/test_transfers.py +59 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_async_clients/test_transfers_control.py +69 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_async_clients/test_verification.py +55 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_sync_clients/__init__.py +0 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_sync_clients/test_apple_pay.py +73 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_sync_clients/test_bulk_charges.py +66 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_sync_clients/test_charge.py +70 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_sync_clients/test_customers.py +87 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_sync_clients/test_dedicated_accounts.py +44 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_sync_clients/test_disputes.py +48 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_sync_clients/test_integration.py +33 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_sync_clients/test_miscellaneous.py +42 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_sync_clients/test_payment_pages.py +67 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_sync_clients/test_payment_requests.py +89 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_sync_clients/test_plans.py +53 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_sync_clients/test_products.py +58 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_sync_clients/test_refunds.py +38 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_sync_clients/test_settlements.py +27 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_sync_clients/test_splits.py +77 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_sync_clients/test_subaccounts.py +51 -0
- {pypaystack2-2.1.0/tests/test_api/test_sync → pypaystack2-3.0.0/tests/test_sub_clients/test_sync_clients}/test_subscriptions.py +28 -28
- pypaystack2-3.0.0/tests/test_sub_clients/test_sync_clients/test_terminals.py +38 -0
- {pypaystack2-2.1.0/tests/test_api/test_sync → pypaystack2-3.0.0/tests/test_sub_clients/test_sync_clients}/test_transactions.py +42 -31
- pypaystack2-3.0.0/tests/test_sub_clients/test_sync_clients/test_transfer_recipients.py +84 -0
- pypaystack2-3.0.0/tests/test_sub_clients/test_sync_clients/test_transfers.py +51 -0
- {pypaystack2-2.1.0/tests/test_api/test_sync → pypaystack2-3.0.0/tests/test_sub_clients/test_sync_clients}/test_transfers_control.py +26 -25
- {pypaystack2-2.1.0/tests/test_api/test_sync → pypaystack2-3.0.0/tests/test_sub_clients/test_sync_clients}/test_verification.py +15 -18
- pypaystack2-3.0.0/uv.lock +980 -0
- pypaystack2-2.1.0/.python-version +0 -1
- pypaystack2-2.1.0/PKG-INFO +0 -38
- pypaystack2-2.1.0/README.md +0 -23
- pypaystack2-2.1.0/docs/how-to-guides.md +0 -125
- pypaystack2-2.1.0/docs/index.md +0 -95
- pypaystack2-2.1.0/docs/reference/apple_pay.md +0 -1
- pypaystack2-2.1.0/docs/reference/bulk_charges.md +0 -1
- pypaystack2-2.1.0/docs/reference/charge.md +0 -1
- pypaystack2-2.1.0/docs/reference/customer.md +0 -1
- pypaystack2-2.1.0/docs/reference/dedicated_accounts.md +0 -1
- pypaystack2-2.1.0/docs/reference/disputes.md +0 -1
- pypaystack2-2.1.0/docs/reference/integration.md +0 -1
- pypaystack2-2.1.0/docs/reference/miscellaneous.md +0 -1
- pypaystack2-2.1.0/docs/reference/payment_pages.md +0 -1
- pypaystack2-2.1.0/docs/reference/payment_requests.md +0 -1
- pypaystack2-2.1.0/docs/reference/plans.md +0 -1
- pypaystack2-2.1.0/docs/reference/products.md +0 -1
- pypaystack2-2.1.0/docs/reference/refunds.md +0 -1
- pypaystack2-2.1.0/docs/reference/settlements.md +0 -1
- pypaystack2-2.1.0/docs/reference/splits.md +0 -1
- pypaystack2-2.1.0/docs/reference/subaccounts.md +0 -1
- pypaystack2-2.1.0/docs/reference/subscriptions.md +0 -1
- pypaystack2-2.1.0/docs/reference/terminals.md +0 -1
- pypaystack2-2.1.0/docs/reference/transactions.md +0 -1
- pypaystack2-2.1.0/docs/reference/transfer_recipients.md +0 -1
- pypaystack2-2.1.0/docs/reference/transfers.md +0 -1
- pypaystack2-2.1.0/docs/reference/transfers_control.md +0 -1
- pypaystack2-2.1.0/docs/reference/verification.md +0 -1
- pypaystack2-2.1.0/docs/tutorials/tutorial1.md +0 -384
- pypaystack2-2.1.0/src/pypaystack2/__init__.py +0 -89
- pypaystack2-2.1.0/src/pypaystack2/api/__init__.py +0 -74
- pypaystack2-2.1.0/src/pypaystack2/api/apple_pay.py +0 -168
- pypaystack2-2.1.0/src/pypaystack2/api/bulk_charges.py +0 -278
- pypaystack2-2.1.0/src/pypaystack2/api/charge.py +0 -344
- pypaystack2-2.1.0/src/pypaystack2/api/customers.py +0 -469
- pypaystack2-2.1.0/src/pypaystack2/api/dedicated_accounts.py +0 -573
- pypaystack2-2.1.0/src/pypaystack2/api/disputes.py +0 -444
- pypaystack2-2.1.0/src/pypaystack2/api/integration.py +0 -66
- pypaystack2-2.1.0/src/pypaystack2/api/miscellaneous.py +0 -174
- pypaystack2-2.1.0/src/pypaystack2/api/payment_pages.py +0 -328
- pypaystack2-2.1.0/src/pypaystack2/api/payment_requests.py +0 -513
- pypaystack2-2.1.0/src/pypaystack2/api/plans.py +0 -336
- pypaystack2-2.1.0/src/pypaystack2/api/products.py +0 -305
- pypaystack2-2.1.0/src/pypaystack2/api/refunds.py +0 -201
- pypaystack2-2.1.0/src/pypaystack2/api/settlements.py +0 -158
- pypaystack2-2.1.0/src/pypaystack2/api/splits.py +0 -357
- pypaystack2-2.1.0/src/pypaystack2/api/subaccounts.py +0 -334
- pypaystack2-2.1.0/src/pypaystack2/api/subscriptions.py +0 -310
- pypaystack2-2.1.0/src/pypaystack2/api/terminals.py +0 -350
- pypaystack2-2.1.0/src/pypaystack2/api/transactions.py +0 -773
- pypaystack2-2.1.0/src/pypaystack2/api/transfer_recipients.py +0 -368
- pypaystack2-2.1.0/src/pypaystack2/api/transfers.py +0 -326
- pypaystack2-2.1.0/src/pypaystack2/api/transfers_control.py +0 -191
- pypaystack2-2.1.0/src/pypaystack2/api/verification.py +0 -181
- pypaystack2-2.1.0/src/pypaystack2/baseapi.py +0 -156
- pypaystack2-2.1.0/src/pypaystack2/exceptions.py +0 -22
- pypaystack2-2.1.0/src/pypaystack2/paystack.py +0 -117
- pypaystack2-2.1.0/src/pypaystack2/utils/__init__.py +0 -76
- pypaystack2-2.1.0/src/pypaystack2/utils/helpers.py +0 -120
- pypaystack2-2.1.0/src/pypaystack2/utils/models.py +0 -340
- pypaystack2-2.1.0/tests/test_api/test_async/test_apple_pay.py +0 -74
- pypaystack2-2.1.0/tests/test_api/test_async/test_bulk_charges.py +0 -92
- pypaystack2-2.1.0/tests/test_api/test_async/test_charge.py +0 -128
- pypaystack2-2.1.0/tests/test_api/test_async/test_customers.py +0 -127
- pypaystack2-2.1.0/tests/test_api/test_async/test_dedicated_accounts.py +0 -43
- pypaystack2-2.1.0/tests/test_api/test_async/test_disputes.py +0 -49
- pypaystack2-2.1.0/tests/test_api/test_async/test_integration.py +0 -42
- pypaystack2-2.1.0/tests/test_api/test_async/test_payment_requests.py +0 -130
- pypaystack2-2.1.0/tests/test_api/test_async/test_plans.py +0 -77
- pypaystack2-2.1.0/tests/test_api/test_async/test_products.py +0 -85
- pypaystack2-2.1.0/tests/test_api/test_async/test_refunds.py +0 -52
- pypaystack2-2.1.0/tests/test_api/test_async/test_settlements.py +0 -42
- pypaystack2-2.1.0/tests/test_api/test_async/test_transfer_recipients.py +0 -114
- pypaystack2-2.1.0/tests/test_api/test_sync/test_apple_pay.py +0 -72
- pypaystack2-2.1.0/tests/test_api/test_sync/test_bulk_charges.py +0 -91
- pypaystack2-2.1.0/tests/test_api/test_sync/test_charge.py +0 -120
- pypaystack2-2.1.0/tests/test_api/test_sync/test_customers.py +0 -127
- pypaystack2-2.1.0/tests/test_api/test_sync/test_dedicated_accounts.py +0 -43
- pypaystack2-2.1.0/tests/test_api/test_sync/test_disputes.py +0 -48
- pypaystack2-2.1.0/tests/test_api/test_sync/test_integration.py +0 -42
- pypaystack2-2.1.0/tests/test_api/test_sync/test_payment_requests.py +0 -122
- pypaystack2-2.1.0/tests/test_api/test_sync/test_plans.py +0 -77
- pypaystack2-2.1.0/tests/test_api/test_sync/test_products.py +0 -85
- pypaystack2-2.1.0/tests/test_api/test_sync/test_refunds.py +0 -52
- pypaystack2-2.1.0/tests/test_api/test_sync/test_settlements.py +0 -42
- pypaystack2-2.1.0/tests/test_api/test_sync/test_splits.py +0 -39
- pypaystack2-2.1.0/tests/test_api/test_sync/test_subaccounts.py +0 -45
- pypaystack2-2.1.0/tests/test_api/test_sync/test_terminals.py +0 -45
- pypaystack2-2.1.0/tests/test_api/test_sync/test_transfer_recipients.py +0 -122
- pypaystack2-2.1.0/tests/test_api/test_sync/test_transfers.py +0 -53
- pypaystack2-2.1.0/tests/test_paystack.py +0 -159
- pypaystack2-2.1.0/tests/test_utils.py +0 -18
- pypaystack2-2.1.0/uv.lock +0 -824
- {pypaystack2-2.1.0 → pypaystack2-3.0.0}/.gitattributes +0 -0
- {pypaystack2-2.1.0 → pypaystack2-3.0.0}/.github/FUNDING.yml +0 -0
- {pypaystack2-2.1.0 → pypaystack2-3.0.0}/.gitignore +0 -0
- {pypaystack2-2.1.0 → pypaystack2-3.0.0}/.nojekyll +0 -0
- {pypaystack2-2.1.0 → pypaystack2-3.0.0}/LICENSE +0 -0
- {pypaystack2-2.1.0 → pypaystack2-3.0.0}/Makefile +0 -0
- {pypaystack2-2.1.0 → pypaystack2-3.0.0}/docs/assets/pypaystack2.svg +0 -0
- {pypaystack2-2.1.0 → pypaystack2-3.0.0}/docs/explanation.md +0 -0
- {pypaystack2-2.1.0 → pypaystack2-3.0.0}/docs/stylesheets/extra.css +0 -0
- {pypaystack2-2.1.0/tests/test_api/test_async → pypaystack2-3.0.0/tests/test_sub_clients}/__init__.py +0 -0
- {pypaystack2-2.1.0/tests/test_api → pypaystack2-3.0.0/tests/test_sub_clients}/mocked_api_testcase.py +0 -0
- {pypaystack2-2.1.0/tests/test_api/test_sync → pypaystack2-3.0.0/tests/test_sub_clients/test_async_clients}/__init__.py +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: Generate [version] documentation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [ published ]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
name: Deploy docs to GitHub Pages
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
- name: Set up Python
|
|
14
|
+
uses: actions/setup-python@v4
|
|
15
|
+
with:
|
|
16
|
+
python-version: "3.10"
|
|
17
|
+
fetch-depth: 0
|
|
18
|
+
- uses: astral-sh/setup-uv@v1
|
|
19
|
+
with:
|
|
20
|
+
version: "latest"
|
|
21
|
+
- name: Install dependencies
|
|
22
|
+
run: uv sync -p 3.10
|
|
23
|
+
- name: Setup doc deploy
|
|
24
|
+
run: |
|
|
25
|
+
git config --global user.name Docs deploy
|
|
26
|
+
git config --global user.email docs@dummy.bot.com
|
|
27
|
+
- name: Set release notes tag
|
|
28
|
+
run: |
|
|
29
|
+
export RELEASE_TAG_VERSION="${{ github.event.release.tag_name }}"
|
|
30
|
+
echo RELEASE_TAG_VERSION="${RELEASE_TAG_VERSION:1}" >> "$GITHUB_ENV"
|
|
31
|
+
- name: Build docs website
|
|
32
|
+
run: uv run mike deploy "${RELEASE_TAG_VERSION}" --push
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
name: Publish Pypaystack2 [version] to PYPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [ "published" ]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
run:
|
|
9
|
+
name: "Build and publish release"
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
- name: Install uv
|
|
14
|
+
uses: astral-sh/setup-uv@v3
|
|
15
|
+
with:
|
|
16
|
+
enable-cache: true
|
|
17
|
+
cache-dependency-glob: uv.lock
|
|
18
|
+
- name: Set up Python
|
|
19
|
+
run: uv python install 3.12 # Or whatever version I want to use.
|
|
20
|
+
|
|
21
|
+
- name: Build
|
|
22
|
+
run: uv build
|
|
23
|
+
|
|
24
|
+
- name: Publish
|
|
25
|
+
run: uv publish -t ${{ secrets.PYPI_TOKEN }}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
|
|
2
2
|
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
|
|
3
3
|
|
|
4
|
-
name:
|
|
4
|
+
name: Pypaystack2 Linting,Formatting and Testing
|
|
5
5
|
|
|
6
6
|
on:
|
|
7
7
|
push:
|
|
@@ -10,33 +10,31 @@ on:
|
|
|
10
10
|
branches: [ "main" ]
|
|
11
11
|
|
|
12
12
|
env:
|
|
13
|
-
|
|
13
|
+
PAYSTACK_SECRET_KEY: ${{ secrets.PAYSTACK_SECRET_KEY }}
|
|
14
14
|
|
|
15
15
|
jobs:
|
|
16
|
-
|
|
16
|
+
test:
|
|
17
17
|
|
|
18
18
|
runs-on: ubuntu-latest
|
|
19
19
|
strategy:
|
|
20
20
|
fail-fast: false
|
|
21
21
|
matrix:
|
|
22
|
-
python-version: [ "3.
|
|
22
|
+
python-version: [ "3.11","3.12", "3.13" ]
|
|
23
23
|
|
|
24
24
|
steps:
|
|
25
25
|
- uses: actions/checkout@v3
|
|
26
26
|
- name: Set up Python ${{ matrix.python-version }}
|
|
27
|
-
uses: actions/setup-python@
|
|
27
|
+
uses: actions/setup-python@v4
|
|
28
28
|
with:
|
|
29
29
|
python-version: ${{ matrix.python-version }}
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
- uses: astral-sh/setup-uv@v1
|
|
31
|
+
with:
|
|
32
|
+
version: "latest"
|
|
33
|
+
- name: Install dependencies with uv
|
|
34
|
+
run: uv sync -p ${{ matrix.python-version }}
|
|
34
35
|
- name: Format with ruff
|
|
35
|
-
run:
|
|
36
|
-
ruff format .
|
|
36
|
+
run: uv run ruff format .
|
|
37
37
|
- name: Lint with ruff
|
|
38
|
-
run:
|
|
39
|
-
ruff check . --fix
|
|
38
|
+
run: uv run ruff check . --fix
|
|
40
39
|
- name: Test package
|
|
41
|
-
run:
|
|
42
|
-
pytest
|
|
40
|
+
run: uv run pytest
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# See https://pre-commit.com for more information
|
|
2
|
+
# See https://pre-commit.com/hooks.html for more hooks
|
|
3
|
+
repos:
|
|
4
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
5
|
+
rev: v3.2.0
|
|
6
|
+
hooks:
|
|
7
|
+
- id: trailing-whitespace
|
|
8
|
+
- id: end-of-file-fixer
|
|
9
|
+
- id: check-yaml
|
|
10
|
+
- id: check-added-large-files
|
|
11
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
12
|
+
# Ruff version.
|
|
13
|
+
rev: v0.9.9
|
|
14
|
+
hooks:
|
|
15
|
+
# Run the linter.
|
|
16
|
+
- id: ruff
|
|
17
|
+
args: [ --fix ]
|
|
18
|
+
# Run the formatter.
|
|
19
|
+
- id: ruff-format
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.11
|
|
@@ -7,11 +7,50 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## unreleased
|
|
9
9
|
|
|
10
|
+
## [3.0.0] - 2025-03-
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Pydantic v2 to project dependencies.
|
|
15
|
+
- Utility methods for fees calculation `calculate_fee`, `to_base_unit`, `to_subunit`.
|
|
16
|
+
- `ClientNetworkError`. An exception raised for all network related errors.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- `auth_key` parameter to `secret_key`.
|
|
21
|
+
- secret key environmental variable name from `PAYSTACK_AUTHORIZATION_KEY` to `PAYSTACK_SECRET_KEY`
|
|
22
|
+
- `MissingAuthKeyException` to `MissingSecretKeyException`
|
|
23
|
+
- Rename wrappers to clients. All usages of wrappers are now deprecated in favour of clients.
|
|
24
|
+
`Paystack` wrapper class in the past is now `PaystackClient` likewise all other api wrappers
|
|
25
|
+
are now sub clients e.g. `ApplePay` is now `ApplePayClient`
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- Unused `amount` parameter in `TransactionClient.export`
|
|
30
|
+
|
|
31
|
+
### Removed
|
|
32
|
+
|
|
33
|
+
- Support for `python<=3.10`
|
|
34
|
+
- Package defined `HTTPMethod` enum. Now using `HTTPMethod` from the standard lib.
|
|
35
|
+
- `validate_amount` and `validate_interval` helper methods
|
|
36
|
+
- `InvalidMethodException`, `InvalidDataException`
|
|
37
|
+
|
|
38
|
+
## [2.1.1] - (9th December 2024)
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
|
|
42
|
+
- Rwanda to paystack supported countries
|
|
43
|
+
- RWF to paystack supported currencies
|
|
44
|
+
|
|
45
|
+
### Changed
|
|
46
|
+
|
|
47
|
+
- Make `TransactionSplit.get_splits` parameters optional
|
|
48
|
+
|
|
10
49
|
### Changed
|
|
11
50
|
|
|
12
51
|
- Charge.setAddress -> Charge.submitAddress
|
|
13
52
|
|
|
14
|
-
## [2.1.0] - 2024
|
|
53
|
+
## [2.1.0] - (8th October 2024)
|
|
15
54
|
|
|
16
55
|
### Added
|
|
17
56
|
|
|
@@ -47,7 +86,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
47
86
|
- Redundant payload from Subscription.send_update_link
|
|
48
87
|
- Redundant payload from AsyncSubscription.send_update_link
|
|
49
88
|
|
|
50
|
-
## [2.0.3] - 2024
|
|
89
|
+
## [2.0.3] - (24th March 2024)
|
|
51
90
|
|
|
52
91
|
### Added
|
|
53
92
|
|
|
@@ -60,7 +99,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
60
99
|
`Response` with the `data` parameter containing a `content` field with the bytes content returned.
|
|
61
100
|
- Mismatched source code and documentation links in docs
|
|
62
101
|
|
|
63
|
-
## [2.0.2] - 2023
|
|
102
|
+
## [2.0.2] - (1st December 2023)
|
|
64
103
|
|
|
65
104
|
### Added
|
|
66
105
|
|
|
@@ -80,13 +119,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
80
119
|
|
|
81
120
|
- Broken docstrings API reference documentation links
|
|
82
121
|
|
|
83
|
-
## [2.0.1] - 2023
|
|
122
|
+
## [2.0.1] - (27th July 2023)
|
|
84
123
|
|
|
85
124
|
### Changed
|
|
86
125
|
|
|
87
126
|
- Refactor project internals
|
|
88
127
|
|
|
89
|
-
## [2.0.0] - 2023
|
|
128
|
+
## [2.0.0] - (18th May 2023)
|
|
90
129
|
|
|
91
130
|
### Added
|
|
92
131
|
|
|
@@ -97,25 +136,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
97
136
|
|
|
98
137
|
- Use `httpx` in place of `requests`
|
|
99
138
|
|
|
100
|
-
## [1.1.3] - 2023
|
|
139
|
+
## [1.1.3] - (10th March 2023)
|
|
101
140
|
|
|
102
141
|
### Added
|
|
103
142
|
|
|
104
143
|
- `Paystack` class which had bindings to other wrappers
|
|
105
144
|
|
|
106
|
-
## [1.0.3] - 2022
|
|
145
|
+
## [1.0.3] - (26th December 2022)
|
|
107
146
|
|
|
108
147
|
### Added
|
|
109
148
|
|
|
110
149
|
- Cleanup documentation
|
|
111
150
|
|
|
112
|
-
## [1.0.2] - 2022
|
|
151
|
+
## [1.0.2] - (25th December 2022)
|
|
113
152
|
|
|
114
153
|
### Added
|
|
115
154
|
|
|
116
155
|
- Implement additional wrappers to cover all endpoints provided by paystack
|
|
117
156
|
|
|
118
|
-
## [1.0.0] - 2022
|
|
157
|
+
## [1.0.0] - (25th July 2022)
|
|
119
158
|
|
|
120
159
|
### Added
|
|
121
160
|
|
|
@@ -125,7 +164,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
125
164
|
|
|
126
165
|
- Breaks projects were it is added as a dependency
|
|
127
166
|
|
|
128
|
-
[unreleased]: https://github.com/gray-adeyi/pypaystack2/compare/v2.
|
|
167
|
+
[unreleased]: https://github.com/gray-adeyi/pypaystack2/compare/v2.1.1...HEAD
|
|
168
|
+
|
|
169
|
+
[2.1.1]: https://github.com/gray-adeyi/pypaystack2/compare/v2.1.0...v2.1.1
|
|
170
|
+
|
|
171
|
+
[2.1.0]: https://github.com/gray-adeyi/pypaystack2/compare/v2.0.3...v2.1.0
|
|
129
172
|
|
|
130
173
|
[2.0.3]: https://github.com/gray-adeyi/pypaystack2/compare/v2.0.2...v2.0.3
|
|
131
174
|
|
|
@@ -133,8 +176,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
133
176
|
|
|
134
177
|
[2.0.1]: https://github.com/gray-adeyi/pypaystack2/compare/v2.0.0...v2.0.1
|
|
135
178
|
|
|
179
|
+
[2.0.0]: https://github.com/gray-adeyi/pypaystack2/compare/v1.1.3...v2.0.0
|
|
180
|
+
|
|
136
181
|
[1.1.3]: https://github.com/gray-adeyi/pypaystack2/compare/v1.0.3...v1.1.3
|
|
137
182
|
|
|
138
183
|
[1.0.3]: https://github.com/gray-adeyi/pypaystack2/compare/v1.0.2...v1.0.3
|
|
139
184
|
|
|
140
185
|
[1.0.2]: https://github.com/gray-adeyi/pypaystack2/compare/v1.0.0...v1.0.2
|
|
186
|
+
|
|
187
|
+
[1.0.0]: https://github.com/gray-adeyi/pypaystack2/releases/tag/v1.0.0
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pypaystack2
|
|
3
|
+
Version: 3.0.0
|
|
4
|
+
Summary: A developer-friendly client library for Paystack
|
|
5
|
+
Author-email: Gbenga Adeyi <adeyigbenga005@gmail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Keywords: paystack,paystack-python,paystackapi,pypaystack
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Programming Language :: Python
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Requires-Python: >=3.11
|
|
13
|
+
Requires-Dist: httpx>=0.28.1
|
|
14
|
+
Requires-Dist: pydantic>=2.10.6
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# PyPaystack2
|
|
18
|
+
|
|
19
|
+
[](https://pepy.tech/project/pypaystack2)
|
|
20
|
+
[](https://pepy.tech/project/pypaystack2)
|
|
21
|
+
[](https://pepy.tech/project/pypaystack2)
|
|
22
|
+
|
|
23
|
+
PyPaystack2 is an Open Source Python client library for integrating [Paystack](https://paystack.com/) into your python
|
|
24
|
+
projects. It aims at being developer friendly and easy to use.
|
|
25
|
+
|
|
26
|
+
**Version 3 is here now**
|
|
27
|
+
|
|
28
|
+
## Features
|
|
29
|
+
|
|
30
|
+
- 1st class support for type annotations.
|
|
31
|
+
- Synchronous and Asynchronous clients.
|
|
32
|
+
- Pydantic for data modelling.
|
|
33
|
+
- Fees Calculation utilities.
|
|
34
|
+
|
|
35
|
+
## Installation
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
$ pip install -U pypaystack2
|
|
39
|
+
# or install with uv
|
|
40
|
+
$ uv add pypaystack2
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Usage Preview
|
|
44
|
+
|
|
45
|
+
In the REPL session below, we're using PyPaystack2 to create a `Customer` (user) and a `Plan` on
|
|
46
|
+
[Paystack](https://paystack.com/) and then add the newly created customer as a subscriber to the plan.
|
|
47
|
+
|
|
48
|
+
### Note
|
|
49
|
+
|
|
50
|
+
The REPL session below assumes the environmental variable `PAYSTACK_SECRET_KEY="YOUR_SECRET_KEY"` is set. if not,
|
|
51
|
+
you can alternatively pass it into the `PaystackClient` on instantiation like so
|
|
52
|
+
`PaystackClient(secret_key='YOUR_SECRET_KEY')` otherwise, you will get a `MissingSecretKeyException` raised prompting
|
|
53
|
+
you to provide a secret key. It also does not handle likely exceptions that calling client methods like
|
|
54
|
+
`client.customers.create`, `client.plans.create` & `client.subscriptions.create` may raise like `ClientNetworkError`
|
|
55
|
+
for network related issues and `ValueError` for validation related issues.
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
Python 3.11.11 (main, Feb 12 2025, 14:51:05) [Clang 19.1.6 ] on linux
|
|
59
|
+
Type "help", "copyright", "credits" or "license" for more information.
|
|
60
|
+
>>> from pypaystack2 import __version__
|
|
61
|
+
>>> print(__version__)
|
|
62
|
+
3.0.0 # Ensure you're running PyPaystack2 version >= 3.0.0 for the following entries to work
|
|
63
|
+
>>> from pypaystack2 import PaystackClient
|
|
64
|
+
>>> from pypaystack2.enums import Interval
|
|
65
|
+
>>> from pypaystack2.models import Customer, Plan
|
|
66
|
+
>>> client = PaystackClient()
|
|
67
|
+
>>> new_customer_response = client.customers.create(email="johndoe@example.com",first_name="John",last_name="Doe")
|
|
68
|
+
>>> assert new_customer_response.status # Validating the request is successful
|
|
69
|
+
>>> new_customer = new_customer_response.data
|
|
70
|
+
>>> assert isinstance(new_customer,Customer) # Showing that we indeed get an instance of a pydantic model name `Customer` a modelled representation of the data returned by paystack as a result of the request to create a new user
|
|
71
|
+
>>> new_plan_response = client.plans.create(name="Test 1k Daily Contributions", amount=client.to_subunit(1000), interval=Interval.DAILY)
|
|
72
|
+
>>> assert new_plan_response.status # Validating the request is successful
|
|
73
|
+
>>> new_plan = new_plan_response.data # Validating the request is successful
|
|
74
|
+
>>> assert isinstance(new_plan,Plan)
|
|
75
|
+
>>> new_subscription_response = client.subscriptions.create(customer=new_customer.customer_code,plan=new_plan.plan_code)
|
|
76
|
+
>>> assert new_subscription_response.status == True # Validating the request is successful
|
|
77
|
+
>>> print(repr(new_subscription_response))
|
|
78
|
+
Response(
|
|
79
|
+
status_code=<HTTPStatus.OK: 200>,
|
|
80
|
+
status=True,
|
|
81
|
+
message='Subscription successfully created',
|
|
82
|
+
data=Subscription(
|
|
83
|
+
customer=87934333,
|
|
84
|
+
plan=2237384,
|
|
85
|
+
integration=630606,
|
|
86
|
+
domain=<Domain.TEST: 'test'>,
|
|
87
|
+
start=1741208073,
|
|
88
|
+
status='active',
|
|
89
|
+
quantity=1,
|
|
90
|
+
amount=100000,
|
|
91
|
+
subscription_code='SUB_4sje2s7kb30m5bt',
|
|
92
|
+
email_token='uqzg0vneparuxtm',
|
|
93
|
+
authorization=368220905,
|
|
94
|
+
easy_cron_id=None,
|
|
95
|
+
cron_expression='54 20 5 3 *',
|
|
96
|
+
next_payment_date=datetime.datetime(2026, 3, 5, 20, 54, tzinfo=TzInfo(UTC)),
|
|
97
|
+
open_invoice=None,
|
|
98
|
+
invoice_limit=0,
|
|
99
|
+
id=759264,
|
|
100
|
+
split_code=None,
|
|
101
|
+
cancelled_at=None,
|
|
102
|
+
updated_at=datetime.datetime(2025, 3, 5, 20, 54, 33, tzinfo=TzInfo(UTC)),
|
|
103
|
+
payments_count=None,
|
|
104
|
+
most_recent_invoice=None,
|
|
105
|
+
invoices=None,
|
|
106
|
+
invoice_history=None),
|
|
107
|
+
meta=None,
|
|
108
|
+
type=None,
|
|
109
|
+
code=None,
|
|
110
|
+
raw={
|
|
111
|
+
'status': True,
|
|
112
|
+
'message': 'Subscription successfully created',
|
|
113
|
+
'data': {
|
|
114
|
+
'customer': 87934333,
|
|
115
|
+
'plan': 2237384,
|
|
116
|
+
'integration': 630606,
|
|
117
|
+
'domain': 'test',
|
|
118
|
+
'start': 1741208073,
|
|
119
|
+
'status': 'active',
|
|
120
|
+
'quantity': 1,
|
|
121
|
+
'amount': 100000,
|
|
122
|
+
'authorization': 368220905,
|
|
123
|
+
'invoice_limit': 0,
|
|
124
|
+
'split_code': None,
|
|
125
|
+
'metadata': None,
|
|
126
|
+
'subscription_code': 'SUB_4sje2s7kb30m5bt',
|
|
127
|
+
'email_token': 'uqzg0vneparuxtm',
|
|
128
|
+
'id': 759264,
|
|
129
|
+
'cancelledAt': None,
|
|
130
|
+
'createdAt': '2025-03-05T20:54:33.000Z',
|
|
131
|
+
'updatedAt': '2025-03-05T20:54:33.000Z',
|
|
132
|
+
'cron_expression': '54 20 5 3 *',
|
|
133
|
+
'next_payment_date': '2026-03-05T20:54:00.000Z',
|
|
134
|
+
'easy_cron_id': None,
|
|
135
|
+
'open_invoice': None}
|
|
136
|
+
})
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Documentation
|
|
140
|
+
|
|
141
|
+
See [Documentation](https://gray-adeyi.github.io/pypaystack2/) for more on this package.
|
|
142
|
+
|
|
143
|
+
## Disclaimer
|
|
144
|
+
|
|
145
|
+
This project is an Open Source client library for [Paystack](https://paystack.com/). It is not officially endorsed or
|
|
146
|
+
affiliated with [Paystack](https://paystack.com/). All trademarks and company names belong to their respective owners.
|
|
147
|
+
|
|
148
|
+
## Contributions
|
|
149
|
+
|
|
150
|
+
Thank you for being interested in contributing to PyPaystack2.
|
|
151
|
+
There are many ways you can contribute to the project:
|
|
152
|
+
|
|
153
|
+
- [Star on GitHub](https://github.com/gray-adeyi/pypaystack2/)
|
|
154
|
+
- Try PyPaystack2 and [report bugs/issues you find](https://github.com/gray-adeyi/pypaystack2/issues/new)
|
|
155
|
+
- [Buy me a coffee](https://www.buymeacoffee.com/jigani)
|
|
156
|
+
|
|
157
|
+
## Other Related Projects
|
|
158
|
+
|
|
159
|
+
| Name | Language | Functionality |
|
|
160
|
+
|------------------------------------------------------------------------------------|-----------------------|----------------------------------------------------------------------------------|
|
|
161
|
+
| [Paystack CLI](https://pypi.org/project/paystack-cli/) | Python | A command line app for interacting with paystack APIs |
|
|
162
|
+
| [paystack](https://github.com/gray-adeyi/paystack) | Go | A client library for integration paystack in go |
|
|
163
|
+
| [@gray-adeyi/paystack-sdk](https://www.npmjs.com/package/@gray-adeyi/paystack-sdk) | Typescript/Javascript | A client library for integrating paystack in Javascript runtimes (Node,Deno,Bun) |
|
|
164
|
+
| [paystack](https://pub.dev/packages/paystack) | Dart | A client library for integration paystack in Dart |
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# PyPaystack2
|
|
2
|
+
|
|
3
|
+
[](https://pepy.tech/project/pypaystack2)
|
|
4
|
+
[](https://pepy.tech/project/pypaystack2)
|
|
5
|
+
[](https://pepy.tech/project/pypaystack2)
|
|
6
|
+
|
|
7
|
+
PyPaystack2 is an Open Source Python client library for integrating [Paystack](https://paystack.com/) into your python
|
|
8
|
+
projects. It aims at being developer friendly and easy to use.
|
|
9
|
+
|
|
10
|
+
**Version 3 is here now**
|
|
11
|
+
|
|
12
|
+
## Features
|
|
13
|
+
|
|
14
|
+
- 1st class support for type annotations.
|
|
15
|
+
- Synchronous and Asynchronous clients.
|
|
16
|
+
- Pydantic for data modelling.
|
|
17
|
+
- Fees Calculation utilities.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
$ pip install -U pypaystack2
|
|
23
|
+
# or install with uv
|
|
24
|
+
$ uv add pypaystack2
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Usage Preview
|
|
28
|
+
|
|
29
|
+
In the REPL session below, we're using PyPaystack2 to create a `Customer` (user) and a `Plan` on
|
|
30
|
+
[Paystack](https://paystack.com/) and then add the newly created customer as a subscriber to the plan.
|
|
31
|
+
|
|
32
|
+
### Note
|
|
33
|
+
|
|
34
|
+
The REPL session below assumes the environmental variable `PAYSTACK_SECRET_KEY="YOUR_SECRET_KEY"` is set. if not,
|
|
35
|
+
you can alternatively pass it into the `PaystackClient` on instantiation like so
|
|
36
|
+
`PaystackClient(secret_key='YOUR_SECRET_KEY')` otherwise, you will get a `MissingSecretKeyException` raised prompting
|
|
37
|
+
you to provide a secret key. It also does not handle likely exceptions that calling client methods like
|
|
38
|
+
`client.customers.create`, `client.plans.create` & `client.subscriptions.create` may raise like `ClientNetworkError`
|
|
39
|
+
for network related issues and `ValueError` for validation related issues.
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
Python 3.11.11 (main, Feb 12 2025, 14:51:05) [Clang 19.1.6 ] on linux
|
|
43
|
+
Type "help", "copyright", "credits" or "license" for more information.
|
|
44
|
+
>>> from pypaystack2 import __version__
|
|
45
|
+
>>> print(__version__)
|
|
46
|
+
3.0.0 # Ensure you're running PyPaystack2 version >= 3.0.0 for the following entries to work
|
|
47
|
+
>>> from pypaystack2 import PaystackClient
|
|
48
|
+
>>> from pypaystack2.enums import Interval
|
|
49
|
+
>>> from pypaystack2.models import Customer, Plan
|
|
50
|
+
>>> client = PaystackClient()
|
|
51
|
+
>>> new_customer_response = client.customers.create(email="johndoe@example.com",first_name="John",last_name="Doe")
|
|
52
|
+
>>> assert new_customer_response.status # Validating the request is successful
|
|
53
|
+
>>> new_customer = new_customer_response.data
|
|
54
|
+
>>> assert isinstance(new_customer,Customer) # Showing that we indeed get an instance of a pydantic model name `Customer` a modelled representation of the data returned by paystack as a result of the request to create a new user
|
|
55
|
+
>>> new_plan_response = client.plans.create(name="Test 1k Daily Contributions", amount=client.to_subunit(1000), interval=Interval.DAILY)
|
|
56
|
+
>>> assert new_plan_response.status # Validating the request is successful
|
|
57
|
+
>>> new_plan = new_plan_response.data # Validating the request is successful
|
|
58
|
+
>>> assert isinstance(new_plan,Plan)
|
|
59
|
+
>>> new_subscription_response = client.subscriptions.create(customer=new_customer.customer_code,plan=new_plan.plan_code)
|
|
60
|
+
>>> assert new_subscription_response.status == True # Validating the request is successful
|
|
61
|
+
>>> print(repr(new_subscription_response))
|
|
62
|
+
Response(
|
|
63
|
+
status_code=<HTTPStatus.OK: 200>,
|
|
64
|
+
status=True,
|
|
65
|
+
message='Subscription successfully created',
|
|
66
|
+
data=Subscription(
|
|
67
|
+
customer=87934333,
|
|
68
|
+
plan=2237384,
|
|
69
|
+
integration=630606,
|
|
70
|
+
domain=<Domain.TEST: 'test'>,
|
|
71
|
+
start=1741208073,
|
|
72
|
+
status='active',
|
|
73
|
+
quantity=1,
|
|
74
|
+
amount=100000,
|
|
75
|
+
subscription_code='SUB_4sje2s7kb30m5bt',
|
|
76
|
+
email_token='uqzg0vneparuxtm',
|
|
77
|
+
authorization=368220905,
|
|
78
|
+
easy_cron_id=None,
|
|
79
|
+
cron_expression='54 20 5 3 *',
|
|
80
|
+
next_payment_date=datetime.datetime(2026, 3, 5, 20, 54, tzinfo=TzInfo(UTC)),
|
|
81
|
+
open_invoice=None,
|
|
82
|
+
invoice_limit=0,
|
|
83
|
+
id=759264,
|
|
84
|
+
split_code=None,
|
|
85
|
+
cancelled_at=None,
|
|
86
|
+
updated_at=datetime.datetime(2025, 3, 5, 20, 54, 33, tzinfo=TzInfo(UTC)),
|
|
87
|
+
payments_count=None,
|
|
88
|
+
most_recent_invoice=None,
|
|
89
|
+
invoices=None,
|
|
90
|
+
invoice_history=None),
|
|
91
|
+
meta=None,
|
|
92
|
+
type=None,
|
|
93
|
+
code=None,
|
|
94
|
+
raw={
|
|
95
|
+
'status': True,
|
|
96
|
+
'message': 'Subscription successfully created',
|
|
97
|
+
'data': {
|
|
98
|
+
'customer': 87934333,
|
|
99
|
+
'plan': 2237384,
|
|
100
|
+
'integration': 630606,
|
|
101
|
+
'domain': 'test',
|
|
102
|
+
'start': 1741208073,
|
|
103
|
+
'status': 'active',
|
|
104
|
+
'quantity': 1,
|
|
105
|
+
'amount': 100000,
|
|
106
|
+
'authorization': 368220905,
|
|
107
|
+
'invoice_limit': 0,
|
|
108
|
+
'split_code': None,
|
|
109
|
+
'metadata': None,
|
|
110
|
+
'subscription_code': 'SUB_4sje2s7kb30m5bt',
|
|
111
|
+
'email_token': 'uqzg0vneparuxtm',
|
|
112
|
+
'id': 759264,
|
|
113
|
+
'cancelledAt': None,
|
|
114
|
+
'createdAt': '2025-03-05T20:54:33.000Z',
|
|
115
|
+
'updatedAt': '2025-03-05T20:54:33.000Z',
|
|
116
|
+
'cron_expression': '54 20 5 3 *',
|
|
117
|
+
'next_payment_date': '2026-03-05T20:54:00.000Z',
|
|
118
|
+
'easy_cron_id': None,
|
|
119
|
+
'open_invoice': None}
|
|
120
|
+
})
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Documentation
|
|
124
|
+
|
|
125
|
+
See [Documentation](https://gray-adeyi.github.io/pypaystack2/) for more on this package.
|
|
126
|
+
|
|
127
|
+
## Disclaimer
|
|
128
|
+
|
|
129
|
+
This project is an Open Source client library for [Paystack](https://paystack.com/). It is not officially endorsed or
|
|
130
|
+
affiliated with [Paystack](https://paystack.com/). All trademarks and company names belong to their respective owners.
|
|
131
|
+
|
|
132
|
+
## Contributions
|
|
133
|
+
|
|
134
|
+
Thank you for being interested in contributing to PyPaystack2.
|
|
135
|
+
There are many ways you can contribute to the project:
|
|
136
|
+
|
|
137
|
+
- [Star on GitHub](https://github.com/gray-adeyi/pypaystack2/)
|
|
138
|
+
- Try PyPaystack2 and [report bugs/issues you find](https://github.com/gray-adeyi/pypaystack2/issues/new)
|
|
139
|
+
- [Buy me a coffee](https://www.buymeacoffee.com/jigani)
|
|
140
|
+
|
|
141
|
+
## Other Related Projects
|
|
142
|
+
|
|
143
|
+
| Name | Language | Functionality |
|
|
144
|
+
|------------------------------------------------------------------------------------|-----------------------|----------------------------------------------------------------------------------|
|
|
145
|
+
| [Paystack CLI](https://pypi.org/project/paystack-cli/) | Python | A command line app for interacting with paystack APIs |
|
|
146
|
+
| [paystack](https://github.com/gray-adeyi/paystack) | Go | A client library for integration paystack in go |
|
|
147
|
+
| [@gray-adeyi/paystack-sdk](https://www.npmjs.com/package/@gray-adeyi/paystack-sdk) | Typescript/Javascript | A client library for integrating paystack in Javascript runtimes (Node,Deno,Bun) |
|
|
148
|
+
| [paystack](https://pub.dev/packages/paystack) | Dart | A client library for integration paystack in Dart |
|
|
Binary file
|
|
Binary file
|