Skip to main content

Python SDK for WePay API (third party).

Project description

python-wepay: Python WePay SDK (third party)

Travis-CI Tests Coverage Code Health Number of PyPI downloads

Features

  • Make API calls in a very natural pythonic way, ex:

>>> api = WePay(production=False, access_token='STAGE_243...')
>>> response = api.account.create("name", "description", type='nonprofit')
>>> account_id = response['account_id']
>>> callback_uri = "https://example.com/ipn/account/%s" % account_id
>>> response = api.account.modify(account_id, callback_uri=callback_uri)
>>> api.preapproval.create("short description", "daily", amount=45.5, account_id=account_id)
{"preapproval_id":619202, "preapproval_uri":"https://stage.wepay.com/api/preapproval/619202"}
  • Validation of all required and optional parameters to each one of the calls.

  • Very easy construction of batch calls, simply by passing batch_mode=True to a call, ex:

>>> call1 = api.checkout.create(1234, short_description, type, amount, batch_mode=True)
>>> call2 = api.withdrawal.find(1235, sort_order='ASC', access_token='access_token_for_other_account', batch_mode=True)
>>> response = api.batch.create(client_id, client_secret, [call1, call2])

About

This package started as a part of Django WePay Application, but I soon realized it could be useful to other developers in Python community that do not use Django. Originally it meant to be an extension of an official Python WePay SDK, but instead it became a replacement. This package is also listed as a third party Python SDK on WePay.

Status

Production.

Requirements

Installation

pip install python-wepay

Documentation

http://python-wepay.readthedocs.org/en/latest/index.html

License

MIT licensed. See the bundled LICENSE file for more details.

Changelog

1.4.3

  • improved documentation.

1.4.0

  • Removed backward compatibility with official Python WePay SDK.

  • introduced WePayHTTPError, which is a base exception for both WePayClientError and WePayServerError

  • added cached_property decorator.

  • changed they way calls are initialized. This change doesn’t affect the way calls are made.

1.3.5

  • Fixed and improved error handling, new exceptions: WePayClientError and WePayServerError.

1.3.4

  • Connection timeout can be specified on per call basis.

1.3.0

  • Python 3 compatible

  • Calls are made using requests library by default (if installed), falls back to urllib if requests are not installed or if WePay is initialized with use_requests=False.

  • WePayConnectionError is raised in case there is a problem connecting to WePay server, ex. timeout.

  • Addition of a full test suit.

  • Minor:

    • ‘original_ip’ and ‘original_device’ params are now optional in /credit_card/create.

    • silent mode is more flexible.

    • Moved SubscriptionPlan and SubscriptionCharge to their own modules.

    • Moved WePayWarning over to wepay.exceptions module.

1.2.0

  • New API version 2014-01-08 changes are reflected in this SDK version:

    • implemented /user/register and user/resend_confirmation calls.

    • added /account/get_update_uri and /account/get_reserve_details

    • depricated /account/add_bank, /account/balance, /account/get_tax and /account/set_tax calls.

  • restructured SDK in such a way that all API objects are separate classes, so as an example, if we have a WePay instance api = WePay() and we want to make a /account/find call, it will look like this api.account.find() instead of api.account_find() (notice . instead of _), although in this version both are equivalent, latter one is depricated and will be removed in version 1.3. Despite these changes lookup calls will be the same, ex. api.account(12345).

  • Added flexibility to use different API version per call basis. So it is now possible to make a depricated call like this: api.account.balance(1234, api_version='2011-01-15')

  • added batch_reference_id keyword argument to each call that accepts batch_mode

1.1.2

  • Added required arguments to /credit_card/create call:

    • original_ip

    • original_device

1.1.0

  • Added subscription calls:

    • /subscription_plan

    • /subscription

    • /subscription_charge

  • Few bug and spelling fixes.

1.0.0

  • Initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-wepay-1.4.3.tar.gz (42.5 kB view details)

Uploaded Source

Built Distributions

python_wepay-1.4.3-py3-none-any.whl (37.6 kB view details)

Uploaded Python 3

python_wepay-1.4.3-py2-none-any.whl (67.5 kB view details)

Uploaded Python 2

File details

Details for the file python-wepay-1.4.3.tar.gz.

File metadata

File hashes

Hashes for python-wepay-1.4.3.tar.gz
Algorithm Hash digest
SHA256 b6c5d424cdf722631c79d7470db2c390c43fdfe7e5839f73848b084786b49b8c
MD5 cc4136486fa5b8886e03abdd3e2bd005
BLAKE2b-256 bb269aa41f9144532895fde49f5fe9e22902d081ac0eb3aff5ed5086e06ea893

See more details on using hashes here.

File details

Details for the file python_wepay-1.4.3-py3-none-any.whl.

File metadata

File hashes

Hashes for python_wepay-1.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f9fb6818ba288cb144a4bee3f1ac4ae1f97041bc9d2bb5d94c3ca62a682a05ad
MD5 a3db5f230d0d284fbf5607a9ec6c3cec
BLAKE2b-256 4fd30c5b18eff32e477558419ff14fffebab97ccf805e26520976044b7d92f47

See more details on using hashes here.

File details

Details for the file python_wepay-1.4.3-py2-none-any.whl.

File metadata

File hashes

Hashes for python_wepay-1.4.3-py2-none-any.whl
Algorithm Hash digest
SHA256 956d094b5f096b59c36fade49ba0f74ef1bc96a4bea2d643da6e612c546f39fb
MD5 3c24d3aa0e1d4add40504f6175e27f8f
BLAKE2b-256 87006e162a6b898d387d26afeecce931c05826952452004f82ef2dc4a17ee487

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page