Skip to main content
Documentation Status Latest Version Number of PyPI downloads Code Health Tests Coverage Travis-CI

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.5.0

  • added /account/membership/ calls.

  • added /user/mfa/ calls.

  • New API version 2015-09-09 changes are reflected in this SDK version:

    • /withrawal/create is deprecated.

  • New API version 2015-08-15 changes are reflected in this SDK version:

    • /account/create now accepts both old and new style params.

  • removed deprecated call /user/resend_confirmation.

  • /accout/create and /account/modify now accept country_options and fee_schedule_slot params

  • added restricted credit_card/transfer call.

1.4.4

  • renamed user.resend_confirmation call to user.send_confirmation.

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

Metadata

Release files for python-wepay 1.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-wepay 1.5.0
File Size Uploaded
python-wepay-1.5.0.tar.gz 49.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-wepay 1.5.0
File Interpreter ABI Platform
python_wepay-1.5.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 120.7 kB

Release files / python-wepay-1.5.0.tar.gz

Download URL python-wepay-1.5.0.tar.gz
Size 49.6 kB
Tags Source
SHA-256 checksum
How to use checksums
fcada2606db578e314d243ec14841d50b60e195af05e4703debf1fd9ef2ddebc
BLAKE2b-256 checksum
How to use checksums
7736e30ac02434467e17ae3177cc98caa124043f8278717826b9c37e848ad651
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / python_wepay-1.5.0-py2.py3-none-any.whl

Download URL python_wepay-1.5.0-py2.py3-none-any.whl
Size 71.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
541f8fcfdfddc72b2dfa0fee5d4093760076970d68abe0a53b08ed8fc61254fb
BLAKE2b-256 checksum
How to use checksums
cbab12055fb602e3490a3ffda44ee0c7948ae4429983c8852097bebf9a81734b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.5.0 This release

2 release files

1.4.4

2 release files

1.4.3

3 release files

1.4.2

3 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.5

2 release files

1.3.4

1 release file

1.3.3

1 release file

1.3.2

1 release file

1.3.1

1 release file

1.3.0

1 release file

1.2.3

1 release file

1.2.2

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.3

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page