{ "info": { "author": "Samuel James and Issa Jubril", "author_email": "samuelvarejames@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6" ], "description": "# paystack-python\n[![Coverage Status](https://coveralls.io/repos/github/andela-sjames/paystack-python/badge.svg?branch=develop)](https://coveralls.io/github/andela-sjames/paystack-python?branch=master)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/andela-sjames/paystack-python/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/andela-sjames/paystack-python/?branch=master)\n[![Circle CI](https://img.shields.io/badge/license-MIT-blue.svg)](https://img.shields.io/badge/license-MIT-blue.svg) [![Build Status](https://travis-ci.org/andela-sjames/paystack-python.svg?branch=master)](https://travis-ci.org/andela-sjames/paystack-python)\n[![PyPI version](https://badge.fury.io/py/paystackapi.svg)](https://badge.fury.io/py/paystackapi)\n\nPython plugin for [Paystack](https://paystack.com/)\nView on [pypi.python.org](https://pypi.python.org/pypi/paystackapi)\n\n# Installation\n```\npip install paystackapi\n```\n# Instantiate Paystack\n\n```python\nfrom paystackapi.paystack import Paystack\npaystack_secret_key = \"5om3secretK3y\"\npaystack = Paystack(secret_key=paystack_secret_key)\n\n# to use transaction class\npaystack.transaction.list()\n\n# to use customer class\npaystack.customer.get(transaction_id)\n\n# to use plan class\npaystack.plan.get(plan_id)\n\n# to use subscription class\npaystack.subscription.list()\n```\n\n## DOC Reference: \n\n##### Other methods can be found below...\n\n# Static Use\n\nTo start using the Paystack Python API, you need to start by setting your secret key.\n\nYou can set your secret key in your environment by running:\n```bash\nexport PAYSTACK_SECRET_KEY = 'your_secret_key'\n```\n\n\n> Don't forget to get your API key from [Paystack](https://paystack.com/) and assign to the variable `PAYSTACK_SECRET_KEY`\n\n## Transactions\n\n##### `Transaction.initialize(reference, amount, email, plan)` - Initialize transaction.\n\n*Usage*\n\n```python\nfrom paystackapi.transaction import Transaction\nresponse = Transaction.initialize(reference='reference',\n amount='amount', email='email')\n```\n\n*Arguments*\n\n- `reference`: Unique transaction reference\n- `amount`: Amount\n- `email`: Email address\n- `plan`: Specified plan (optional)\n\n*Returns*\n\nJSON data from Paystack API.\n\n##### `Transaction.charge(reference, authorization_code, email, amount)` - Charge authorization.\n\n```python\nfrom paystackapi.transaction import Transaction\nresponse = Transaction.charge(reference='reference',\n authorization_code='authorization_code',\n email='email',\n amount='amount')\n```\n\n*Arguments*\n\n- `reference`: Unique transaction reference\n- `authorization_code`: Authorization code for the transaction\n- `email`: Email Address of the user with the authorization code\n- `amount`: Amount in kobo\n\n*Returns*\n\nJSON data from Paystack API.\n\n##### `Transaction.charge_token(reference, token, email, amount)` - Charge Token.\n\n```python\nfrom paystackapi.transaction import Transaction\nresponse = Transaction.charge_token(reference='reference',\n token='token', email='email',\n amount='amount')\n```\n\n*Arguments*\n\n- reference: unique transaction reference\n- token: paystack token\n- email: Email Address\n- amount: Amount in Kobo\n\n*Returns*\n\nJSON data from Paystack API.\n\n##### `Transaction.get(transaction_id)` - Get a single transaction.\n\n```python\nfrom paystackapi.transaction import Transaction\nresponse = Transaction.get(transaction_id=23)\n```\n\n*Arguments*\n\n- `id`: Transaction id(integer).\n\n*Returns*\n\nJSON data from paystack API.\n\n##### `Transaction.list()` - List transactions.\n\n```python\nfrom paystackapi.transaction import Transaction\nresponse = Transaction.list()\n```\n\n*Arguments*\n\nNo argument required.\n\n*Returns*\n\nJSON data from paystack API.\n\n##### `Transaction.totals()` - Get totals.\n\n```python\nfrom paystackapi.transaction import Transaction\nresponse = Transaction.totals()\n```\n*Arguments*\n\nNo argument required.\n\n*Returns*\n\nJSON data from paystack API.\n\n##### `Transaction.verify(reference)` - Verify transactions.\n\n```python\nfrom paystackapi.transaction import Transaction\nresponse = Transaction.verify(reference='reference')\n```\n\n*Arguments*\n\n- `reference`: a unique value needed for transaction.\n\n*Returns*\n\nJSON data from paystack API.\n\n\n## Plans\n\n##### `Plan.create(name, description, amount, interval, send_invoices, send_sms, hosted_page, hosted_page_url, hosted_page_summary, currency)` - Create a plan\n\n```python\nfrom paystackapi.plan import Plan\nresponse = Plan.create(name='value', description='value',\n amount=amount, interval='value',\n send_invoices='value',\n send_sms='value',\n hosted_page='value',\n hosted_page_url='value',\n hosted_page_summary='value',\n currency='value')\n```\n\n*Arguments*\n\n- `name`: plan's name.\n- `description`: description of the plan.\n- `amount`: amount for the plan in kobo\n- `interval`: plan's interval(daily...etc)\n- `send_invoices`: boolean\n- `send_sms`: (optional)\n- `hosted_page`: (optional)\n- `hosted_page_url`: url of hosted page (optional)\n- `hosted_page_summary`: summary of the hosted page\n- `currency`: plans currency (NGN)\n\n*Returns*\n\nJSON data from paystack API.\n\n##### `Plan.get(plan_id)` - Get a single plan.\n\n```python\nfrom paystackapi.plan import Plan\nresponse = Plan.get(plan_id=25)\n```\n\n*Arguments*\n\n- `id`: paystack plan id.\n\n*Returns*\n\nJSON data from paystack API.\n\n##### `Plan.list()` - List paystack plan\n\n```python\nfrom paystackapi.plan import Plan\nresponse = Plan.list()\n```\n\n*Arguments*\n\nNo argument required.\n\n*Returns*\n\nJSON data from paystack API.\n\n##### `Plan.update(plan_id=88, name=None, description=None, amount=None, interval=None, send_invoices=None, send_sms=None, hosted_page=None, hosted_page_url=None, hosted_page_summary=None, currency=None)` - Update paystack plan\n\n```python\nfrom paystackapi.plan import Plan\nresponse = Plan.update(plan_id=23, name=None, description=None,\n amount=None, interval=None,\n send_invoices=None, send_sms=None,\n hosted_page=None, hosted_page_url=None,\n hosted_page_summary=None, currency=None)\n```\n\n*Arguments*\n\n- `plan_id`: plan identity number.\n- `name`: name of plan\n- `description`: plan description(optional)\n- `amount`: plan amount in Kobo\n- `interval`: plan interval9(monthly, yearly, quarterly...etc)\n- `send_invoice`: (optional)\n- `send_sms`: (optional)\n- `hosted_page`: (optional)\n- `hosted_page_url`: (optional)\n- `hosted_page_summary`: (optional)\n- `currency`: Naira in kobo(NGN)\n\n*Returns*\n\nJSON data from paystack API.\n\n\n## Customers\n\n##### `Customer.create(first_name, last_name, email, phone)` - Create customer\n\n```python\nfrom paystackapi.customer import Customer\nresponse = Customer.create(first_name='first_name',\n last_name='last_name',\n email='email', phone='phone')\n```\n\n*Arguments*\n\n- `first_name`: customer's first name.\n- `last_name`: customer's last name.\n- `email`: customer's email address.\n- `phone`: customer's phone number.\n\n*Returns*\n\nJSON data from paystack API.\n\n##### `Customer.get(customer_id)` - Get customers by id\n\n```python\nfrom paystackapi.customer import Customer\nresponse = Customer.get(customer_id=24)\n```\n\n*Arguments*\n\n- `id`: paystack customer id\n\n*Returns*\n\nJSON data from paystack API.\n\n##### `Customer.list()` - List paystack customers\n\n```python\nfrom paystackapi.customer import Customer\nresponse = Customer.list()\n```\n\n*Arguments*\n\nNo argument required.\n\n*Returns*\n\nJSON data from paystack API.\n\n##### `Customer.update(customer_id, first_name=None, last_name=None, email=None, phone=None)` - Update paystack customer data by id.\n\n```python\nfrom paystackapi.customer import Customer\nresponse = Customer.update(customer_id=24, first_name=None,\n last_name=None, email=None,\n phone=None)\n```\n\n*Arguments*\n- `customer_id`: paystack customer id.\n- `first_name`: customer's first name(optional).\n- `last_name`: customer's last name(optional).\n- `email`: customer's email address(optional).\n- `phone`: customer's phone number(optional).\n\n*Returns*\n\nJSON data from paystack API.\n\n## Subscription\n\n##### `Subscription.create(customer, plan, authorization, start_date)` - Create subscription.\n\n```python\nfrom paystackapi.subscription import Subscription\nresponse = Subscription.create(customer='CUS_xnxdt6s1zg1f4nx',\n plan='Pln_2yudUnIds2p',\n authorization='34',\n start_date=None)\n```\n\n*Arguments*\n- `customer`: Customer's email address or customer code.\n- `plan`: Plan code.\n- `authorization`: customers authorization code.\n- `start_date`: the date for the first debit. (ISO 8601 format)\n\n*Returns*\n\nJSON data from paystack API.\n\n##### `Subscription.fetch(subscription_id)` - Fetch subscription.\n\n```python\nfrom paystackapi.subscription import Subscription\nresponse = Subscription.fetch(subscription_id=4033)\n```\n\n*Arguments*\n- `subscription_id`: subscription id.\n\n*Returns*\n\nJSON data from paystack API.\n\n\n##### `Subscription.list()` - List subscriptions.\n\n```python\nfrom paystackapi.subscription import Subscription\nresponse = Subscription.list()\n```\n\n*Arguments*\n\nNo argument required.\n\n*Returns*\n\nJSON data from paystack API.\n\n##### `Subscription.disable(code=\"SUB_vsyqdmlzble3uii\",token=\"d7gofp6yppn3qz7\")` - Disable subscriptions.\n\n```python\nfrom paystackapi.subscription import Subscription\nresponse = Subscription.disable(code=\"SUB_vsyqdmlzble3uii\",\n token=\"d7gofp6yppn3qz7\")\n```\n\n*Arguments*\n\n*Arguments*\n- `code`: Subscription code.\n- `token`: Email token.\n\n\n*Returns*\n\nJSON data from paystack API.\n\n##### `Subscription.enable(code=\"SUB_vsyqdmlzble3uii\",token=\"d7gofp6yppn3qz7\")` - Enable subscriptions.\n\n```python\nfrom paystackapi.subscription import Subscription\nresponse = Subscription.enable(code=\"SUB_vsyqdmlzble3uii\",\n token=\"d7gofp6yppn3qz7\")\n```\n\n*Arguments*\n- `code`: Subscription code.\n- `token`: Email token.\n\n\n*Returns*\n\nJSON data from paystack API.\n\n## Verification\n\n##### `Verification.verify_bvn(bvn)` - verify a customer's BVN\n\n```python\nfrom paystackapi.verification import Verification\nresponse = Verification.verify_bvn(bvn='1234567890')\n```\n\n*Arguments*\n\n- `bvn`: customer's bvn number\n\n*Returns*\n\nJSON data from paystack API.\n\n\n##### `Verification.verify_account(account_number)` - verify a customer's BVN\n\n```python\nfrom paystackapi.verification import Verification\nresponse = Verification.verify_account(account_number='1234567890')\n```\n\n*Arguments*\n\n- `account_number`: customer's account number\n\n*Returns*\n\nJSON data from paystack API.\n\n\n##### `Verification.verify_card_bin(card_bin)` - verify a customer's card bin\n\n```python\nfrom paystackapi.verification import Verification\nresponse = Verification.verify_card_bin(card_bin='001')\n```\n\n*Arguments*\n\n- `card_bin`: customer's card bin\n\n*Returns*\n\nJSON data from paystack API.\n\n\n##### `Verification.verify_phone(verification_type, phone, callback_url)` - verify a customer's phone number\n\n```python\nfrom paystackapi.verification import Verification\nresponse = Verification.verify_phone(\n verification_type='truecaller',\n phone='090123456890,\n callback_url='https://google.com'\n)\n```\n\n*Arguments*\n\n- `verification_type`: phone number verification type\n- `phone`: phone number to be verified\n- `callback_url`: callback url to send verification details to\n\n*Returns*\n\nJSON data from paystack API.\n\nRefunds\n-------\n#### `Refund.create(**kwargs)` - This creates a refund which is then processed by the Paystack team\n\n```python\nfrom paystackapi.refund import Refund\nresponse = Refund.create(**kwargs)\n\n```\n*Arguments*\n- `transaction`: Transaction reference or id\n- `amount`: How much in kobo to be refunded to the customer - Optional\n- `currency`: Three-letter ISO currency - Optional\n- `customer_note`: Customer reason - Optional\n- `merchant_note`: Merchant reason - Optional\n\n*Returns*\n\nJSON data from paystack API.\n\n\n#### `Refund.list(**kwargs)` - Get a list of refunds\n\n```python\nfrom paystackapi.refund import Refund\nresponse = Refund.list(**kwargs)\n\n```\n*Arguments*\n- `reference`: Identifier for transaction to be refunded - Optional\n- `currency`: Three-letter ISO currency - Optional\n\n*Returns*\n\nJSON data from paystack API.\n\n#### `Refund.fetch(refund_id)` - Get a refund by its id\n\n```python\nfrom paystackapi.refund import Refund\nresponse = Refund.fetch(refund_id=1234)\n\n```\n*Arguments*\n- `refund_id`: Refund ID\n\n*Returns*\n\nJSON data from paystack API.\n\n\nProduct\n-------\n#### `Product.create(**kwargs)` - Create a Product\n\n*Usage*\n\n```python\nfrom paystackapi.product import Product\nresponse = Product.create(name=\"Product pypaystack test\",\n\t\t\t\t\t\t description=\"my test description\",\n price=500000, currency=\"NGN\", **kwargs)\n```\n\n*Arguments*\n\n- `name`: Name of the product\n- `description`: Description of product\n- `price`: Price of the product, in kobo(Integer)\n- `currency`: Currency in which amount should be charged\n- **kwargs\n\n*Returns*\n\nJSON data from Paystack API.\n\n\n#### `Product.list()` - list created Products\n\n*Usage*\n\n```python\nfrom paystackapi.product import Product\nresponse = Product.list()\n```\n\n*Arguments*\n\nNo argument required.\n\n*Returns*\n\nJSON data from Paystack API.\n\n\n#### `Product.fetch(product_id)` - fetch created Products by id\n\n*Usage*\n\n```python\nfrom paystackapi.product import Product\nresponse = Product.fetch(product_id=5499)\n```\n\n*Arguments*\n\n- `product_id`: Product id(integer).\n\n*Returns*\n\nJSON data from Paystack API.\n\n\n#### `Product.update(product_id, **kwargs)` - update a created Product by id\n\n*Usage*\n\n```python\nfrom paystackapi.product import Product\nresponse = Product.update(product_id=5499, **kwargs)\n```\n\n*Arguments*\n\n- `product_id`: Paystack product id.\n- `name`: Name of the product\n- `description`: Description of product\n- `price`: Price of the product, in kobo(Integer)\n- `currency`: Currency in which amount should be charged\n- `**kwargs`\n\n*Returns*\n\nJSON data from Paystack API.\n\n\nSubAccount\n-------\n#### `SubAccount.create(**kwargs)` - Create a SubAccount\n\n*Usage*\n\n```python\nfrom paystackapi.subaccount import SubAccount\nresponse = SubAccount.create(\n business_name=\"Test Biz 123\",\n settlement_bank=\"Access Bank\",\n account_number=\"xxxxxxxxx\",\n percentage_charge=\"6.9\"\n )\n```\n\n*Arguments*\n\n- `business_name`: Name of business for subaccount\n- `settlement_bank`: Name of Bank (accepted banks)\n- `account_number`: NUBAN Bank Account number\n- `percentage_charge`: Default percentage charged on subaccount?\n- `**kwargs`\n\n*Returns*\n\nJSON data from Paystack API.\n\n#### `SubAccount.list(perPage, page)` - List a SubAccount\n\n*Usage*\n\n```python\nfrom paystackapi.subaccount import SubAccount\nresponse = SubAccount.list(perPage=3, page=1)\n```\n\n*Arguments*\n\n- `perPage`: Records you want to retrieve per page (Integer)\n- `page`: What page you want to retrieve (Integer)\n- `**kwargs`\n\n*Returns*\n\nJSON data from Paystack API.\n\n\n#### `SubAccount.fetch(id_or_slug)` - Fetch a SubAccount\n\n*Usage*\n\n```python\nfrom paystackapi.subaccount import SubAccount\nresponse = SubAccount.fetch(id_or_slug=\"some_slug_like_subaccount_code_or_id)\n```\n\n*Arguments*\n\n- `id_or_slug`: ID or Subaccount_Code\n\n*Returns*\n\nJSON data from Paystack API.\n\n\n#### `SubAccount.update(id_or_slug, **kwargs)` - Update a SubAccount\n\n*Usage*\n\n```python\nfrom paystackapi.subaccount import SubAccount\nresponse = SubAccount.update(\n id_or_slug=\"some_slug_like_subaccount_code_or_id),\n **kwargs\n )\n```\n\n*Arguments*\n\n- `id_or_slug`: ID or Subaccount_Code\n- `business_name`: Name of business for subaccount\n- `settlement_bank`: Name of Bank (accepted banks)\n- `account_number`: NUBAN Bank Account number\n- `percentage_charge`: Default percentage charged on subaccount?\n- `**kwargs`\n\n*Returns*\n\nJSON data from Paystack API.\n\nPayment Page\n-------\n#### `Page.create(name, **kwargs)` - Create a Page\n\n*Usage*\n\n```python\nfrom paystackapi.page import Page\nresponse = Page.create(\n name=\"New test product One\"\n )\n```\n\n*Arguments*\n- `name`: name of page\n- `**kwargs`\n\n*Returns*\n\nJSON data from Paystack API.\n\n#### `Page.list(perPage, page)` - List a Page\n\n*Usage*\n\n```python\nfrom paystackapi.page import Page\nresponse = Page.list(perPage=3, page=1)\n```\n\n*Arguments*\n- `perPage`: records you want to retrieve per page (Integer)\n- `page`: what page you want to retrieve (Integer)\n\n*Returns*\n\nJSON data from Paystack API.\n\n#### `Page.fetch(id_or_slug)` - Fetch a Page\n\n*Usage*\n\n```python\nfrom paystackapi.page import Page\nresponse = Page.fetch(id_or_slug=\"5nApBwZkvY\")\n```\n\n*Arguments*\n- `id_or_slug`: id or slug\n\n*Returns*\n\nJSON data from Paystack API.\n\n#### `Page.update(id_or_slug)` - Update a Page by id_or_slug\n\n*Usage*\n\n```python\nfrom paystackapi.page import Page\nresponse = Page.update(id_or_slug=\"5nApBwZkvY\", **kwargs)\n```\n\n*Arguments*\n- `id_or_slug`: id or slug\n- `**kwargs`\n\n*Returns*\n\nJSON data from Paystack API.\n\n#### `Page.is_slug_available(id_or_slug)` - Check Slug Availability\n\n*Usage*\n\n```python\nfrom paystackapi.page import Page\nresponse = Page.is_slug_available(slug=\"new_or_existing_slug\")\n```\n\n*Arguments*\n- `slug`: URL slug to be confirmed\n\n*Returns*\n\nJSON data from Paystack API.\n\n#### `Page.add_products(id_or_slug)` - Add products to payment page\n\n*Usage*\n\n```python\nfrom paystackapi.page import Page\nresponse = Page.add_products(\n\t\t\t\tpayment_page_id=\"new_or_existing_slug\"\n \tproduct=[123, 456, 457]\n )\n```\n\n*Arguments*\n\n- `payment_page_id`: Id of the payment page (Integer)\n- `product`: Ids of all the products i.e. [473, 292]\n\n*Returns*\n\nJSON data from Paystack API.\n\nSettlements\n-------\n#### `Settlement.fetch(**kwargs)` - Fetch a Settlement\n\n*Usage*\n\n```python\nfrom paystackapi.settlement import Settlement\nresponse = Settlement.fetch(\n from=\"2016-09-12T00:00:00.000Z\",\n to=\"2016-09-12T00:00:00.000Z\",\n subaccount=\"subaccount\"\n )\n```\n\n*Arguments*\n\n- `start_date`: Lower bound of date range. Leave undefined to export settlement from day one.\n- `end_date`: Upper bound of date range.Leave undefined to export settlements till date.\n- `subaccount`: code to export only settlements for that subaccount. Set to none to export only transactions for the account.\n\n*Returns*\n\nJSON data from Paystack API.\n\n\nControl Panel\n-------------\n#### `ControlPanel.fetch_payment_session_timeout()` - Fetch payment session timeout\n\n*Usage*\n\n```python\nfrom paystackapi.cpanel import ControlPanel\nresponse = ControlPanel.fetch_payment_session_timeout()\n```\n\n*Arguments*\n\nNo argument required.\n\n*Returns*\n\nJSON data from Paystack API.\n\n\n#### `ControlPanel.update_payment_session_timeout(timeout)` - Update payment session timeout\n\n*Usage*\n\n```python\nfrom paystackapi.cpanel import ControlPanel\nresponse = ControlPanel.update_payment_session_timeout(timeout=30)\n```\n\n*Arguments*\n\n- `timeout`: Time before stopping session (in seconds). Set to 0 to cancel session timeouts\n\n*Returns*\n\nJSON data from Paystack API.\n\n\nInvoices\n--------\n\n#### `Invoice.create(**kwargs)` - Create a new invoice.\n\n*Usage*\n\n```python\nfrom paystackapi.invoice import Invoice\nresponse = Invoice.create(\n customer=\"CUS_je02lbimlqixzax\",\n amount=42000,\n due_date=\"2019-05-08T00:00:00.000Z\"\n )\n```\n\n*Arguments*\n\n- `customer`: customer id or code\n- `amount`: payment request amount.(Integer) Only useful if line items and tax values are ignored. Endpoint will throw a friendly warning if neither is available.\n- `due_date`: ISO 8601 representation of request due date.\n- `**kwargs`\n\n*Returns*\n\nJSON data from Paystack API.\n\n\n#### `Invoice.list(**kwargs)` - list created invoice(s).\n\n*Usage*\n\n```python\nfrom paystackapi.invoice import Invoice\nresponse = Invoice.list(\n customer=\"CUS_je02lbimlqixzax\",\n status=\"pending\",\n currency=\"NGN\",\n paid=\"false\",\n include_archive=\"true\"\n )\n```\n\n*Arguments*\n- `customer`: filter by customer ID\n- `status`: filter by invoice status\n- `currency`: filter by currency\n- `paid`: filter by paid invoice\n- `include_archive`: include_archive\n\n*Returns*\n\nJSON data from Paystack API.\n\n#### `Invoice.view(invoice_id_or_code)` - view created invoice(s).\n\n*Usage*\n\n```python\nfrom paystackapi.invoice import Invoice\nresponse = Invoice.view(\n invoice_id_or_code=\"PRQ_kp4lleqc7g8xckk\",\n )\n```\n\n*Arguments*\n- `invoice_id_or_code`: invoice ID or Code (string)\n\n*Returns*\n\nJSON data from Paystack API.\n\n#### `Invoice.verify(invoice_code)` - verify created/existing invoice.\n\n*Usage*\n\n```python\nfrom paystackapi.invoice import Invoice\nresponse = Invoice.verify(\n invoice_code=\"PRQ_kp4lleqc7g8xckk\",\n )\n```\n\n*Arguments*\n- `invoice_code`: invoice Code (string)\n\n*Returns*\n\nJSON data from Paystack API.\n\n\n#### `Invoice.send_notification(id_or_code)` - Send invoice notification.\n\n*Usage*\n\n```python\nfrom paystackapi.invoice import Invoice\nresponse = Invoice.send_notification(\n id_or_code=\"PRQ_kp4lleqc7g8xckk\",\n )\n```\n\n*Arguments*\n- `id_or_code`: id or code (string)\n\n*Returns*\n\nJSON data from Paystack API.\n\n\n#### `Invoice.dashboard_metrics()` - Get dashboard metrics\n*Usage*\n\n```python\nfrom paystackapi.invoice import Invoice\nresponse = Invoice.dashboard_metrics()\n```\n\n*Arguments*\n\tNo Arguments required\n\n*Returns*\n\tJSON data from Paystack API.\n\n\n#### `Invoice.finalize_draft(id_or_code, **kwargs)` - Finalize a draft\n*Usage*\n\n```python\nfrom paystackapi.invoice import Invoice\nresponse = Invoice.finalize_draft(\n id_or_code=\"PRQ_kp4lleqc7g8xckk\",\n send_notification=False\n )\n```\n\n*Arguments*\n- `id_or_code`: ID or Code (string)\n- `send_notification`: Indicates whether Paystack sends an email notification to customer. Defaults to true. (Boolean)\n\n*Returns*\n\tJSON data from Paystack API.\n\n\n#### `Invoice.update(id_or_code, **kwargs)` - Update a draft\n*Usage*\n\n```python\nfrom paystackapi.invoice import Invoice\nresponse = Invoice.update(\n id_or_code=\"PRQ_kp4lleqc7g8xckk\",\n amount=450000\n )\n```\n\n*Arguments*\n- `id_or_code`: ID or Code\n- `**kwargs`\n\n*Returns*\n\tJSON data from Paystack API.\n\n\n#### `Invoice.archive(id_or_code)` - Archive a draft\n*Usage*\n\n```python\nfrom paystackapi.invoice import Invoice\nresponse = Invoice.archive(\n id_or_code=\"PRQ_kp4lleqc7g8xckk\",\n )\n```\n\n*Arguments*\n- `id_or_code`: ID or Code\n\n*Returns*\n\tJSON data from Paystack API.\n\n#### `Invoice.update_transfer_recipient(recipient_code_or_id, **kwargs)` - Update transfer recipienta draft\n*Usage*\n\n```python\nfrom paystackapi.invoice import Invoice\nresponse = Invoice.update_transfer_recipient(\n recipient_code_or_id=\"PRQ_kp4lleqc7g8xckk\",\n name=\"new name\",\n email=\"new@email.com\"\n )\n```\n\n*Arguments*\n- `recipient_code_or_id`: recipient code or ID\n- `name`: a name for the recipient (string)\n- `email`: the email address of the recipient (string)\n\n*Returns*\n\tJSON data from Paystack API.\n\nTransfer Recipient\n---------------------\n#### `TransferRecipient.create(**kwargs)` - Create a new Transfer Recipient.\n\n*Usage*\n\n```python\nfrom paystackapi.trecipient import TransferRecipient\nresponse = TransferRecipient.create(\n type=\"nuban\",\n name=\"Zombie\",\n description=\"Zombier\",\n account_number=\"01000000010\",\n bank_code=\"044\",\n )\n```\n\n*Arguments*\n\n- `type`: Recipient Type (Only nuban at this time)\n- `name`: A name for the recipient\n- `account_number`: Required if type is nuban\n- `bank_code`: Required if type is nuban. You can get the list of Bank Codes by calling the List Banks endpoint.\n- `**kwargs`\n\n*Returns*\n\nJSON data from Paystack API.\n\n\n#### `TransferRecipient.list(**kwargs)` - list Transfer Recipient.\n\n*Usage*\n\n```python\nfrom paystackapi.trecipient import TransferRecipient\nresponse = TransferRecipient.list(perPage=3, page=1)\n```\n\n*Arguments*\n\n- `perPage`: records you want to retrieve per page (Integer)\n- `page`: what page you want to retrieve (Integer)\n\n\n*Returns*\n\nJSON data from Paystack API.\n\n\nTransfer\n--------\n#### `Transfer.initiate(**kwargs)` - Initiate a new Transfer.\n\n*Usage*\n\n```python\nfrom paystackapi.transfer import Transfer\nresponse = Transfer.initiate(\n source=\"balance\",\n reason=\"Calm down\",\n amount=\"3794800\",\n recipient=\"RCP_gx2wn530m0i3w3m\",\n )\n```\n\n*Arguments*\n\n- `source`: Where should we transfer from? Only balance for now\n- `amount`: Amount to transfer in kobo\n- `currency`: Currency type to use\n- `recipient`: Code for transfer recipient\n- `**kwargs`\n\n*Returns*\n\nJSON data from Paystack API.\n\n#### `Transfer.list(**kwargs)` - List a Transfer.\n\n*Usage*\n\n```python\nfrom paystackapi.transfer import Transfer\nresponse = Transfer.list(perPage=3,page=1)\n```\n\n*Arguments*\n\n- `perPage`: records you want to retrieve per page (Integer)\n- `page`: what page you want to retrieve (Integer)\n\n*Returns*\n\nJSON data from Paystack API.\n\n#### `Transfer.fetch(id_or_code)` - Fetch a Transfer.\n\n*Usage*\n\n```python\nfrom paystackapi.transfer import Transfer\nresponse = Transfer.fetch(\n id_or_code=\"TRF_2x5j67tnnw1t98k\",\n )\n```\n\n*Arguments*\n\n- `id_or_code`: An ID or code for the transfer whose details you want to retrieve.\n\n*Returns*\n\nJSON data from Paystack API.\n\n#### `Transfer.finalize(**kwargs)` - Finalize a Transfer.\n\n*Usage*\n\n```python\nfrom paystackapi.transfer import Transfer\nresponse = Transfer.finalize(\n transfer_code=\"TRF_2x5j67tnnw1t98k\",\n otp=\"928783\"\n )\n```\n\n*Arguments*\n\n- `transfer_code`: Transfer code\n- `otp`: OTP sent to business phone to verify transfer\n\n\n*Returns*\n\nJSON data from Paystack API.\n\n\n#### `Transfer.initiate_bulk_transfer(**kwargs)` - Initiate a bulk Transfer.\n\n*Usage*\n\n```python\nfrom paystackapi.transfer import Transfer\nresponse = Transfer.initiate_bulk_transfer(\n currency=\"TRF_2x5j67tnnw1t98k\",\n source=\"928783\",\n transfers=[\n {\n \"amount\": 50000,\n \"recipient\": \"RCP_db342dvqvz9qcrn\"\n },\n {\n \"amount\": 50000,\n \"recipient\": \"RCP_db342dvqvz9qcrn\"\n }\n ]\n )\n```\n\n*Arguments*\n```Text\ncurrency: Currency type to use\nsource: Where should we transfer from? Only balance for now\ntransfers: Array of transfer objects [\n {\n amount: Amount to transfer in kobo\n recipient: Code for transfer recipient\n },\n {\n amount: Amount to transfer in kobo\n recipient: Code for transfer recipient\n }\n]\n```\n*Returns*\n\nJSON data from Paystack API.\n\n\n#### `Transfer.verify(**kwargs)` - Finalize a Transfer.\n\n*Usage*\n\n```python\nfrom paystackapi.transfer import Transfer\nresponse = Transfer.verify(\n reference=\"ref_demo\",\n )\n```\n\n*Arguments*\n- `reference`: Transfer reference\n\n\n*Returns*\n\nJSON data from Paystack API.\n\nCharge\n--------------------\n#### `Charge.start_charge(**kwargs)` - Start a Chsrge\n\n*Usage*\n\n```python\nfrom paystackapi.charge import Charge\nresponse = Charge.start_charge(\n email=\"CUS_je02lbimlqixzax\",\n amount=42000,\n metadata={\n \"custom_fields\": [\n {\n \"value\":\"makurdi\",\n \"display_name\": \"Donation for\",\n \"variable_name\": \"donation_for\"\n },\n ],\n },\n bank={\n \"code\":\"057\",\n \"account_number\":\"0000000000\"\n },\n birthday=\"1995-12-23\"\n )\n\n```\n\n*Arguments*\n\n- `email`: Customer's email address\n- `amount`: Amount in kobo\n- `**kwargs`\n\n*Returns*\n\nJSON data from Paystack API.\n\n#### `Charge.submit_pin(**kwargs)` - Submit PIN to continue a charge.\n\n*Usage*\n\n```python\nfrom paystackapi.charge import Charge\nresponse = Charge.submit_pin(\n pin=\"0987\",\n reference=\"5bwib5v6anhe9xa\",\n )\n```\n\n*Arguments*\n\n- `pin`: PIN submitted by user\n- `reference`: reference for transaction that requested pin\n\n*Returns*\n\nJSON data from Paystack API.\n\n\n#### `Charge.submit_otp(**kwargs)` - Submit OTP to complete a charge.\n\n*Usage*\n\n```python\nfrom paystackapi.charge import Charge\nresponse = Charge.submit_otp(\n otp=\"0987\",\n reference=\"5bwib5v6anhe9xa\",\n )\n```\n\n*Arguments*\n\n- `otp`: OTP submitted by user\n- `reference`: reference for ongoing transaction\n\n*Returns*\n\nJSON data from Paystack API.\n\n\n#### `Charge.submit_phone(**kwargs)` - Submit Phone when requested.\n\n*Usage*\n\n```python\nfrom paystackapi.charge import Charge\nresponse = Charge.submit_phone(\n phone=\"0XX4XX9X0XF\",\n reference=\"5bwib5v6anhe9xa\",\n )\n```\n\n*Arguments*\n\n- `phone`: Phone submitted by user\n- `reference` : reference for ongoing transaction\n*Returns*\n\nJSON data from Paystack API.\n\n#### `Charge.submit_birthday(**kwargs)` - Submit Birthday when requested.\n\n*Usage*\n\n```python\nfrom paystackapi.charge import Charge\nresponse = Charge.submit_birthday(\n birthday=\"1975-12-23\",\n reference=\"5bwib5v6anhe9xa\",\n )\n```\n\n*Arguments*\n\n- `birthday`: Birthday submitted by user\n- `reference`: reference for ongoing transaction\n\n*Returns*\n\nJSON data from Paystack API.\n\n#### `Charge.check_pending(reference)` - Check pending charge\n\n*Usage*\n\n```python\nfrom paystackapi.charge import Charge\nresponse = Charge.check_pending(\n reference=\"5bwib5v6anhe9xa\",\n )\n```\n\n*Arguments*\n\n- `reference`: The reference to check\n\n*Returns*\n\nJSON data from Paystack API.\n\nTransferControl\n--------------\n\n#### `TransferControl.check_balance(**kwargs)` - Check Balance.\n\n*Usage*\n\n```python\nfrom paystackapi.tcontrol import TransferControl\nresponse = TransferControl.check_balance()\n\n```\n\n*Arguments*\n\nNo argument required.\n\n*Returns*\n\nJSON data from Paystack API.\n\n\n#### `TransferControl.resend_otp(**kwargs)` - Resend OTP for Transfer.\n\n*Usage*\n\n```python\nfrom paystackapi.tcontrol import TransferControl\nresponse = TransferControl.resend_otp(\n transfer_code=\"TRF_vsyqdmlzble3uii\",\n reason=\"Just do it.\"\n )\n```\n\n*Arguments*\n\n- `transfer_code`: Transfer code\n- `reason`: either resend_otp or transfer\n\n*Returns*\n\nJSON data from Paystack API.\n\n\n#### `TransferControl.disable_otp_finalize(**kwargs)` - Finalize Disabling of OTP requirement for Transfers\n\n*Usage*\n\n```python\nfrom paystackapi.tcontrol import TransferControl\nresponse = TransferControl.disable_otp_finalize(\n otp=\"928783\",\n )\n```\n\n*Arguments*\n\n- `otp`: OTP sent to business phone to verify disabling OTP requirement\n\n*Returns*\n\nJSON data from Paystack API.\n\n\n#### `TransferControl.disable_otp()` - Disable OTP requirement for Transfers\n\n*Usage*\n\n```python\nfrom paystackapi.tcontrol import TransferControl\nresponse = TransferControl.disable_otp()\n```\n\n*Arguments*\n\nNo arguments required\n\n*Returns*\n\nJSON data from Paystack API.\n\n#### `TransferControl.enable_otp(**kwargs)` - Enable OTP requirement for Transfers\n\n*Usage*\n\n```python\nfrom paystackapi.tcontrol import TransferControl\nresponse = TransferControl.enable_otp()\n```\n\n*Arguments*\n\nNo arguments required\n\n*Returns*\n\nJSON data from Paystack API.\n\n\nBulkCharge\n--------------\n\n#### `BulkCharge.initiate_bulk_charge(bulkcharge)` - Initiate Bulk Charge.\n\n*Usage*\n\n```python\nfrom paystackapi.bulkcharge import BulkCharge\nresponse = BulkCharge.initiate_bulk_charge(\n bulkcharge=[\n {\"authorization\": \"AUTH_n95vpedf\", \"amount\": 2500}, \n {\"authorization\": \"AUTH_ljdt4e4j\", \"amount\": 1500}\n ]\n )\n```\n\n*Arguments*\n- `authorization`: Authorization token\n- `amount`: Amount in kobo\n\n*Returns*\n\nJSON data from Paystack API.\n\n\n#### `BulkCharge.list(**kwargs)` - List Bulk Charge Batches created by the integration.\n\n*Usage*\n\n```python\nfrom paystackapi.bulkcharge import BulkCharge\nresponse = BulkCharge.list()\n```\n\n*Arguments*\n\n- `perPage`: Number of transfer listed per page for pagination\n- `page`: number of pages listed by pagination.\n\n*Returns*\n\nJSON data from Paystack API.\n\n\n#### `BulkCharge.fetch_bulk_batch(id_or_code)` - This endpoint retrieves a specific batch code.\n\n*Usage*\n\n```python\nfrom paystackapi.bulkcharge import BulkCharge\nresponse = BulkCharge.fetch_bulk_batch(\n id_or_code=\"BCH_orj0ttn8vtp80hx\"\n )\n```\n\n*Arguments*\n- `id_or_code`: An ID or code for the transfer whose details you want to retrieve.\n\n*Returns*\n\nJSON data from Paystack API.\n\n#### `BulkCharge.fetch_charges_batch(id_or_code, **kwargs)` - Fetch the charges associated with a specified batch code.\n\n*Usage*\n\n```python\nfrom paystackapi.bulkcharge import BulkCharge\nresponse = BulkCharge.fetch_charges_batch(\n id_or_code=\"BCH_orj0ttn8vtp80hx\"\n )\n```\n\n*Arguments*\n\n- `id_or_code`: An ID or code for the batch whose charges you want to retrieve.\n- `status`: pending, success or failed\n- `perPage`: Number of transfers listed per page for pagination\n- `page`: number of pages listed by pagination.\n\n*Returns*\n\nJSON data from Paystack API.\n\n#### `BulkCharge.pause_bulk_batch(batch_code)` - Pause the proccessing of an ongoing bulk charge batch.\n\n*Usage*\n\n```python\nfrom paystackapi.bulkcharge import BulkCharge\nresponse = BulkCharge.pause_bulk_batch(\n batch_code=\"BCH_orj0ttn8vtp80hx\"\n )\n```\n\n*Arguments*\n- `batch_code`: code of the batch to be paused\n\n\n*Returns*\n\nJSON data from Paystack API.\n\n\n#### `BulkCharge.resume_bulk_charge(batch_code)` - Resume the proccessing of an already paused bulk charge batch.\n\n*Usage*\n\n```python\nfrom paystackapi.bulkcharge import BulkCharge\nresponse = BulkCharge.resume_bulk_charge(\n batch_code=\"BCH_orj0ttn8vtp80hx\"\n )\n```\n\n*Arguments*\n- `batch_code`: code of the batch to be resumed\n\n*Returns*\n\nJSON data from Paystack API.\n\n\nMiscellaneous\n-------------\n\n``Misc.list_banks()`` - List Banks\n\n```python\n from paystackapi.misc import Misc\n response = Misc.list_banks()\n```\n*Returns*\n\nJSON data from paystack API.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/andela-sjames/paystack-python", "keywords": "paystack python library", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "paystackapi", "package_url": "https://pypi.org/project/paystackapi/", "platform": "", "project_url": "https://pypi.org/project/paystackapi/", "project_urls": { "Homepage": "https://github.com/andela-sjames/paystack-python" }, "release_url": "https://pypi.org/project/paystackapi/2.0.0/", "requires_dist": null, "requires_python": "", "summary": "A python library to consume Paystack API", "version": "2.0.0" }, "last_serial": 5931815, "releases": { "1.2.1": [ { "comment_text": "", "digests": { "md5": "58ebc239d731bd3e0ba7f7d241730be6", "sha256": "159f74eb68897615703cf95f59200e68167f5455a54f026ecf22568938978b1e" }, "downloads": -1, "filename": "paystackapi-1.2.1.tar.gz", "has_sig": false, "md5_digest": "58ebc239d731bd3e0ba7f7d241730be6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5732, "upload_time": "2016-03-11T12:21:09", "url": "https://files.pythonhosted.org/packages/f2/85/8a2ca8d6d5a45dfc21c991a8f393d800588b8bbdec0be00c51b77babcc3b/paystackapi-1.2.1.tar.gz" } ], "1.2.2": [], "1.2.3": [ { "comment_text": "", "digests": { "md5": "8603e9727256378597435dec09bfed53", "sha256": "e3b4a829f4451742ae96e3c1f80adeaa987bf58a85fab50d0f5159e91966fb1a" }, "downloads": -1, "filename": "paystackapi-1.2.3.tar.gz", "has_sig": false, "md5_digest": "8603e9727256378597435dec09bfed53", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7511, "upload_time": "2016-04-03T19:16:56", "url": "https://files.pythonhosted.org/packages/08/02/0a2a955b0f870d9eb6805adb81a743c60da96e029942c50d7446208f8b33/paystackapi-1.2.3.tar.gz" } ], "1.2.4": [ { "comment_text": "", "digests": { "md5": "46f6445fd5340b3780a8c9946c55adb0", "sha256": "d0fd1e300d08ea36d598cbdd0a65826a5ad0bddb35f3290fe9b565db7ee46856" }, "downloads": -1, "filename": "paystackapi-1.2.4.tar.gz", "has_sig": false, "md5_digest": "46f6445fd5340b3780a8c9946c55adb0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7523, "upload_time": "2016-04-09T07:34:55", "url": "https://files.pythonhosted.org/packages/e1/d3/5e8313684032df339d4d0629544035141391d5d22818f53bdd8c0afa773e/paystackapi-1.2.4.tar.gz" } ], "1.2.5": [ { "comment_text": "", "digests": { "md5": "d88885184814d5f666464e063615a0c4", "sha256": "1307b5875caa588db731310b21f0e2b58dd366fdbb0c51d26c876c676913023a" }, "downloads": -1, "filename": "paystackapi-1.2.5.tar.gz", "has_sig": false, "md5_digest": "d88885184814d5f666464e063615a0c4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7118, "upload_time": "2017-04-25T19:50:59", "url": "https://files.pythonhosted.org/packages/62/61/42ad1c5b069cc634beab3243be19a62fd431e4ffa5bb4297245c1daef60f/paystackapi-1.2.5.tar.gz" } ], "1.2.6": [ { "comment_text": "", "digests": { "md5": "9d316427d955ea73a081ec4a5a0e52be", "sha256": "fe0633f2d653ab29cc26899d91b271b2e19c2c0e1d1ea65cc215cee0ea038e2f" }, "downloads": -1, "filename": "paystackapi-1.2.6.tar.gz", "has_sig": false, "md5_digest": "9d316427d955ea73a081ec4a5a0e52be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7117, "upload_time": "2017-04-28T10:32:52", "url": "https://files.pythonhosted.org/packages/1b/3d/d75f73d1f4d7b7fb6cbfe225b7eab7041ac283a408cead79975a8a192d59/paystackapi-1.2.6.tar.gz" } ], "1.2.7": [ { "comment_text": "", "digests": { "md5": "c462b6fa4e22e7a64ce189f1046d7656", "sha256": "2ded92c450e695f0589708068209ba67db43bdee0b37e248296dcb385fb388be" }, "downloads": -1, "filename": "paystackapi-1.2.7.tar.gz", "has_sig": false, "md5_digest": "c462b6fa4e22e7a64ce189f1046d7656", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8086, "upload_time": "2018-08-21T23:53:23", "url": "https://files.pythonhosted.org/packages/95/1f/c6740588787916148574e55c78aa670315553548657e1ea3c6f92343ee84/paystackapi-1.2.7.tar.gz" } ], "1.9.0": [ { "comment_text": "", "digests": { "md5": "d3671c2aec66ac3dd68752f9416870ed", "sha256": "1570c2990c618f68925d727823ba224f2059d6bc923e0a33bf92b53292cee6aa" }, "downloads": -1, "filename": "paystackapi-1.9.0.tar.gz", "has_sig": false, "md5_digest": "d3671c2aec66ac3dd68752f9416870ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33390, "upload_time": "2019-10-05T11:52:53", "url": "https://files.pythonhosted.org/packages/59/42/3b8073889dc0ec049166684d820f263ea94bebe42c0f605f2b6ab2c10317/paystackapi-1.9.0.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "b5a26e54b0f815c72b4e2f6b23a2e81b", "sha256": "6d7483d54c8c6ae1e4e6028593f15801cc5b9df1bfcbfbf31b3dc2ac776d0e73" }, "downloads": -1, "filename": "paystackapi-2.0.0.tar.gz", "has_sig": false, "md5_digest": "b5a26e54b0f815c72b4e2f6b23a2e81b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33392, "upload_time": "2019-10-05T12:00:08", "url": "https://files.pythonhosted.org/packages/f1/08/3a5ff59274aa3ac17bf872aa98c1d9795efa3cafb6335ec691639f20f723/paystackapi-2.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b5a26e54b0f815c72b4e2f6b23a2e81b", "sha256": "6d7483d54c8c6ae1e4e6028593f15801cc5b9df1bfcbfbf31b3dc2ac776d0e73" }, "downloads": -1, "filename": "paystackapi-2.0.0.tar.gz", "has_sig": false, "md5_digest": "b5a26e54b0f815c72b4e2f6b23a2e81b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33392, "upload_time": "2019-10-05T12:00:08", "url": "https://files.pythonhosted.org/packages/f1/08/3a5ff59274aa3ac17bf872aa98c1d9795efa3cafb6335ec691639f20f723/paystackapi-2.0.0.tar.gz" } ] }