# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['paddle']

package_data = \
{'': ['*']}

install_requires = \
['requests>=2.23.0,<3.0.0']

setup_kwargs = {
    'name': 'paddle-client',
    'version': '1.0.0',
    'description': 'Python wrapper around the Paddle.com API',
    'long_description': '# Paddle Client\n\nA python (3.5+) wrapper around the [Paddle.com API](https://developer.paddle.com/api-reference/intro)\n\nIf you are looking at integrating Paddle with Django check out [dj-paddle](https://github.com/paddle-python/dj-paddle)\n\nThe full documentation is available at: https://paddle-client.readthedocs.io\n\n_Note: Several of the Paddle Endpoints are currently not working as expected. See [Failing endpoints](#failing-endpoints)_ below.\n\n## Quick start\n\n### Installation\n\n```bash\npip install paddle-client\n```\n\n\n### Basic Usage\n\nTo use the Paddle API you will need a Paddle Vendor ID and API key which can be found on [Paddle\'s authentication page](https://vendors.paddle.com/authentication)\n\n```python\nfrom paddle import PaddleClient\n\n\npaddle = PaddleClient(vendor_id=12345, api_key=\'myapikey\')\npaddle.list_products()\n```\n\nIf `vendor_id` and `api_key` are not passed through when initialising Paddle will fall back and try and use environmental variables called `PADDLE_VENDOR_ID` and `PADDLE_API_KEY`\n```bash\nexport PADDLE_VENDOR_ID=12345\nexport PADDLE_API_KEY="myapikey"\n```\n\n```python\nfrom paddle import PaddleClient\n\n\npaddle = PaddleClient()\npaddle.list_products()\n```\n\n\n### Paddle sandbox environment\n\nThe [Paddle sandbox environment](https://developer.paddle.com/getting-started/sandbox) is a separate Paddle environment which can be used for development and testing. You are required to create a new account in this environment, different to your production account.\n\nOnce you have this account setup and configured you can user the sandbox account by passing `sandbox=True` when initialising the Paddle Client. This will send all API calls to the Paddle sandbox URLs instead of the production URLs\n\n```python\nfrom paddle import PaddleClient\n\n\npaddle = PaddleClient(vendor_id=12345, api_key=\'myapikey\', sandbox=True)\n```\n\nIt is also possible to turn the sandbox environment on using an environmental variable called `PADDLE_SANDBOX`:\n```bash\nexport PADDLE_SANDBOX="true"\n```\n```python\nfrom paddle import PaddleClient\n\n\npaddle = PaddleClient(vendor_id=12345, api_key=\'myapikey\')\n```\n\n## Documentation\n\nThe full documentation is available on Read the Docs: https://paddle-client.readthedocs.io\n\n\n## Contributing\n\nAll contributions are welcome and appreciated. Please see [CONTRIBUTING.md](https://github.com/paddle-python/paddle-client/blob/master/CONTRIBUTING.md) for more details including details on how to run tests etc.\n\n\n## Paddle Endpoints\n\nThe below endpoints from the [Paddle API Reference](https://developer.paddle.com/api-reference) have been implemented\n\nFor full details see the [API Reference in the docs](https://paddle-client.readthedocs.io/en/latest/api_reference.html). This includes details on parameters and return types for all the different methods as well as other helper methods around the Paddle.com API.\n\nSee [`Usage`](#usage) below for quick examples.\n\n**Checkout API**\n* [Get Order Details](https://developer.paddle.com/api-reference/checkout-api/order-information/getorder)\n* [Get User History](https://checkout.paddle.com/api/2.0/user/history)\n* [Get Prices](https://developer.paddle.com/api-reference/checkout-api/prices/getprices)\n\n**Product API**\n* [List Coupons](https://developer.paddle.com/api-reference/product-api/coupons/listcoupons)\n* [Create Coupon](https://developer.paddle.com/api-reference/product-api/coupons/createcoupon)\n* [Delete Coupon](https://developer.paddle.com/api-reference/product-api/coupons/deletecoupon)\n* [Update Coupon](https://developer.paddle.com/api-reference/product-api/coupons/updatecoupon)\n* [List Products](https://developer.paddle.com/api-reference/product-api/products/getproducts)\n* [List Transactions](https://developer.paddle.com/api-reference/product-api/transactions/listtransactions)\n* [Refund Payment](https://developer.paddle.com/api-reference/product-api/payments/refundpayment)\n\n**Subscription API**\n* [List Plans](https://developer.paddle.com/api-reference/subscription-api/plans/listplans)\n* [Create Plan](https://developer.paddle.com/api-reference/subscription-api/plans/createplan)\n* [List Subscription Users](https://developer.paddle.com/api-reference/subscription-api/subscription-users/listusers)\n* [Cancel Subscription](https://developer.paddle.com/api-reference/subscription-api/subscription-users/canceluser)\n* [Update Subscription](https://developer.paddle.com/api-reference/subscription-api/subscription-users/updateuser)\n* [Add Modifier](https://developer.paddle.com/api-reference/subscription-api/modifiers/createmodifier)\n* [Delete Modifier](https://developer.paddle.com/api-reference/subscription-api/modifiers/deletemodifier)\n* [List Modifiers](https://developer.paddle.com/api-reference/subscription-api/modifiers/listmodifiers)\n* [List Payments](https://developer.paddle.com/api-reference/subscription-api/payments/listpayments)\n* [Reschedule Payment](https://developer.paddle.com/api-reference/subscription-api/payments/updatepayment)\n* [Create One-off Charge](https://developer.paddle.com/api-reference/subscription-api/one-off-charges/createcharge)\n\n**Alert API**\n* [Get Webhook History](https://developer.paddle.com/api-reference/alert-api/webhooks/webhooks)\n\n\n### Usage\n\nSee the [API Reference in the docs](https://paddle-client.readthedocs.io/en/latest/api_reference.html) for full usage with param are return details.\n\n```python\n# Checkout API\npaddle.get_order_details(checkout_id=\'aaaa-bbbb-cccc-1234\')\npaddle.get_user_history(email=\'test@example.com\')\npaddle.get_prices(product_ids=[1234])\n\n# Product API\npaddle.list_coupons(product_id=1234)\npaddle.create_coupon(\n    coupon_type=\'product\',\n    discount_type=\'percentage\',\n    discount_amount=50,\n    allowed_uses=1,\n    recurring=False,\n    currency=\'USD\',\n    product_ids=[1234],\n    coupon_code=\'50%OFF\',\n    description=\'50% off coupon over $10\',\n    expires=\'2030-01-01 10:00:00\',\n    minimum_threshold=10,\n    group=\'paddle-python\',\n)\npaddle.delete_coupon(coupon_code=\'mycoupon\', product_id=1234)\npaddle.update_coupon(\n    coupon_code=\'mycoupon\',\n    new_coupon_code=\'40%OFF\',\n    new_group=\'paddle-python-test\',\n    product_ids=[1234],\n    expires=\'2030-01-01 10:00:00\',\n    allowed_uses=1,\n    currency=\'USD\',\n    minimum_threshold=10,\n    discount_amount=40,\n    recurring=True\n)\npaddle.list_products()\npaddle.list_transactions(entity=\'subscription\', entity_id=1234)\npaddle.refund_product_payment(order_id=1234, amount=0.01, reason=\'reason\')\n\n# Subscription API\npaddle.list_plans()\npaddle.get_plan(plan=123)\npaddle.create_plan(\n    plan_name=\'plan_name\',\n    plan_trial_days=14,\n    plan_length=1,\n    plan_type=\'month\',\n    main_currency_code=\'USD\',\n    initial_price_usd=50,\n    recurring_price_usd=50,\n)\npaddle.list_subscription_users()\npaddle.cancel_subscription(subscription_id=1234)\npaddle.update_subscription(subscription_id=1234, pause=True)\npaddle.update_subscription(\n    subscription_id=1234,\n    quantity=10.00,\n    currency=\'USD\',\n    recurring_price=10.00,\n    bill_immediately=False,\n    plan_id=123,\n    prorate=True,\n    keep_modifiers=True,\n    passthrough=\'passthrough\',\n)\npaddle.pause_subscription(subscription_id=1234)\npaddle.resume_subscription(subscription_id=1234)\npaddle.add_modifier(subscription_id=1234, modifier_amount=10.5)\npaddle.delete_modifier(modifier_id=10)\npaddle.list_modifiers()\npaddle.list_subscription_payments()\npaddle.reschedule_subscription_payment(payment_id=4567, date=\'2030-01-01\')\npaddle.create_one_off_charge(\n    subscription_id=1234,\n    amount=0.0,\n    charge_name="Add X on top of subscription"\n)\n\n# Alert API\npaddle.get_webhook_history()\n```\n',
    'author': 'Matt Pye',
    'author_email': 'pyematt@gmail.com',
    'maintainer': None,
    'maintainer_email': None,
    'url': 'https://github.com/paddle-python/paddle-client',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'python_requires': '>=3.5.0,<4.0.0',
}


setup(**setup_kwargs)
