skip to navigation
skip to content

Not Logged In

python-wepay 1.3.5

Python SDK for WePay API (third party).

Latest Version: 1.5.0

Python WePay SDK (third party)

.. image::
:alt: Travis-CI

.. image::
:alt: Tests Coverage

.. image::
:alt: Number of PyPI downloads


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

.. code-block:: python

>>> api = WePay(production=False, access_token='STAGE_243...')
>>> response = api.credit_card.create(client_id, cc_number, ..., original_ip='127...')
>>> api.credit_card.authorize(client_id, client_secret, response['credit_card_id'])

* 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:

.. code-block:: python

>>> calls = []
>>> calls.append(api.credit_card.authorize(
... client_id, client_secret, response['credit_card_id'],
... batch_mode=True, batch_reference_id='ref_id_1234'))
>>> # append more calls ...
>>> response = api.batch.create(client_id, client_secret, calls)


This package started as a part of `Django WePay Application
<https:"" lehins="" django-wepay="">`_, but I soon realized it could be
useful to other developers in Python community that do not use `Django
<https:"">`_. Originally it meant to be an extension of an
official `Python WePay SDK <https:"" wepay="" python-sdk="">`_, but instead
it became a replacement with full compatibilty with official WePay version.
This package is also listed as a `third party Python SDK on WePay
<https:"" developer="" resources="" sdks="">`_.




* Python >= 2.7 or >= 3.2
* Registered Application with WePay `production <https:"">`_ site or
it's `development <https: stage.wepay="">`_ clone.
* `six <https:"" pypi="" six="">`_.
* `requests <http:"" en="" latest=""/>`_ (optional):
* `mock <https:"" pypi="" mock="">`_ (optional, for tests only)


pip install python-wepay



MIT licensed. See the bundled `LICENSE <https:"" lehins="" python-wepay="" blob="" master="" license="">`_ file for more details.



* Fixed and improved error handling, new exceptions: :exc:`WePayClientError<wepay.exceptions.wepayclienterror>` and :exc:`WePayServerError<wepay.exceptions.wepayservererror>`


* Connection `timeout` can be specified on per call basis.


* Python 3 compatible
* Calls are made using `requests <http:"" en="" latest=""/>`_
library by default (if installed), falls back to `urllib
<https:"" 3="" library="" urllib.html#module-urllib="">`_ if `requests`
are not installed or if ``WePay`` is initialized with
* ``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
* ``silent`` mode is more flexible.
* Moved ``SubscriptionPlan`` and ``SubscriptionCharge`` to their own modules.
* Moved ``WePayWarning`` over to ``wepay.exceptions`` module.


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

* 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,

* added ``batch_reference_id`` keyword argument to each call that accepts


* Added required arguments to `/credit_card/create` call:

* original_ip
* original_device


* Added subscription calls:

* `/subscription_plan`
* `/subscription`
* `/subscription_charge`

* Few bug and spelling fixes.


* Initial release  
File Type Py Version Uploaded on Size
python-wepay-1.3.5.tar.gz (md5) Source 2014-08-16 41KB
python_wepay-1.3.5-py2-none-any.whl (md5) Python Wheel py2 2014-08-16 36KB
  • Downloads (All Versions):
  • 144 downloads in the last day
  • 847 downloads in the last week
  • 2747 downloads in the last month