devRaphael13 / py4paystack

MIT License
1 stars 0 forks source link

Py4paystack

A paystack API wrapper with type checking written in python

Contents



Installation

Run pip install py4paystack on the commandline to install.



Requirements



Changelog

V1.0.2



Type Checking

The Type checking funtion is on by default, turn of by setting TYPE_CHECK to False in your .env file.


Accept Payments

To accept payments, you can import the Transaction class from the transaction module in the routes directory if that'll be all you need, alternatively you can import the Paystack class like if you need more functionality.

from py4paystack.routes.transactions import Transaction # or from py4paystack.paystack import Paystack

trans = Transaction('ExampleSecretKey') # or
trans = Paystack('ExampleSecretKey).transaction()

res = trans.initialize('testemail@test.com', 120934)

Where 'testemail@test.com' is the users email and 120934 is the amount in the smallest denomination of the currency i.e in Naira the user would be paying N1,209.34k

This returns data in JSON format e.g something that looks like this

{
  "status": true,
  "message": "Authorization URL created",
  "data": {
    "authorization_url": "https://checkout.paystack.com/0peioxfhpn",
    "access_code": "0peioxfhpn",
    "reference": "7PVGX8MEk85tgeEpVDtD"
  }
}

Redirect the user to "authorization_url" to accept the payment.


Advanced Usage

For more use cases keep reading........... or check out paystack api documentation


Routes






Paystack

py4paystack.paystack.Paystack


Paystack(secret_key: str)

General class that hold all the functionalities of the Paystack API (essentially a class to rule them all). Methods returns and instance of the class with the same name i.e Paystack('Paystack secret_key').charge() is equivalent to Charge('Paystack secret_key'), use the first approach if you are going to need multiple functionalities and don't want to import each class individually and the second when you just need one class or functionality e.g you just need the Transaction class.

Methods


Back to the top

Apple Pay

py4paystack.routes.apple_pay.ApplePay


ApplePay(secret_key: str)

The Apple Pay API allows you register your application's top-level domain or subdomain


Methods




Back to the top

Bulk Charges

py4paystack.routes.bulk_charges.BulkCharges


BulkCharges(secret_key: str)

The Bulk Charges API allows you create and manage multiple recurring payments from your customers


Methods







Back to the top

Charge

py4paystack.routes.charge.Charge


Charge(secret_key: str)

The Charge API allows you to configure payment channel of your choice when initiating a payment.


Methods:




Back to the top

Control Panel

py4paystack.routes.control_panel.ControlPanel


ControlPanel(*args, **kwargs)

The Control Panel API allows you manage some settings on your integration

Methods:


Back to the top

Customer

py4paystack.routes.customer.Customer


Customer(secret_key: str)

The Customers class allows you create and manage customers on your integration.


Methods:


Back to the top

Disputes

py4paystack.routes.disputes.Disputes


Disputes(secret_key: str)

The Disputes API allows you manage transaction disputes on your integration


Methods:


Back to the top

Dedicated Virtual Accounts

py4paystack.routes.virtual_accounts.DedicatedVirtualAccounts


DedicatedVirtualAccounts(secret_key: str)

The Dedicated Virtual Account class enables Nigerian merchants to manage unique payment accounts of their customers.

Methods:










Back to the top

Invoice

py4paystack.routes.invoice.Invoice

Invoice(secret_key: str)

The Invoices API allows you issue out and manage payment requests

Methods:









Back to the top

Miscellaneous

py4paystack.routes.miscellaneous.Miscellaneous


Miscellaneous(secret_key: str)

The Miscellaneous API are supporting APIs that can be used to provide more details to other APIs

Methods:




Back to the top

Payment Pages

py4paystack.routes.payment_pages.PaymentPages


PaymentPages(secret_key: str)

The Payment Pages API provides a quick and secure way to collect payment for products.

Methods:







Back to the top

Plan

py4paystack.routes.plans.Plan


Plan(secret_key: str)

The Plans API allows you create and manage installment payment options on your integration

Methods:





Back to the top

Product

py4paystack.routes.product.Product


Product(secret_key: str)

The Products API allows you create and manage inventories on your integration

Methods:






Back to the top

Refund

py4paystack.routes.refund.Refund


Refund(secret_key: str)

The Refunds API allows you create and manage transaction refunds

Methods:




Back to the top

Settlements

py4paystack.routes.settlement.Settlement


Settlements(secret_key: str)

The Settlements API allows you gain insights into payouts made by Paystack to your bank account

Methods:




Back to the top

SubAccounts

py4paystack.routes.subaccounts.SubAccounts


SubAccounts(secret_key: str)

The Subaccounts API allows you create and manage subaccounts on your integration. Subaccounts can be used to split payment between two accounts (your main account and a sub account)

Methods:






Back to the top

Subscription


Subscription(secret_key: str)

py4paystack.routes.subscription.Subscription

The Subscriptions API allows you create and manage recurring payment on your integration

Methods:








Back to the top

Transaction Split


py4paystack.routes.transaction_split.TransactionSplit

TransactionSplit(secret_key: str)

Create, list, retrieve, update split transaction configuration with one or more SubAccounts (You should have subaccounts on your integration to use this)

Methods:








Back to the top

Transaction

py4paystack.routes.transaction.Transaction


Transaction(secret_key: str)

Accept payment from your customers. The Transactions API allows you create and manage payments on your integration

Methods:











Back to the top

Transfer Recipient

py4paystack.routes.transfer_recipient.TransferRecipient


TransferRecipient(secret_key: str)

The Transfer Recipients API allows you create and manage beneficiaries that you send money to

Methods:








Back to the top

Transfer Control

py4paystack.routes.transfer_control.TransferControl


TransferControl(secret_key: str)

The Transfers Control API allows you manage settings of your transfers

Methods:








Back to the top

Transfer

py4paystack.routes.transfer.Transfer


Transfer(secret_key: str)

The Transfers API allows you automate sending money on your integration

Methods:







Back to the top

Verification

py4paystack.routes.verification.Verification


Verification(secret_key: str)

The Verification class allows you perform KYC ( Know Your Customer ) processes. This feature is only available to businesses in Nigeria.

Methods:





Back to the top