- 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, 'USD', 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])
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.
Production.
- Python >= 2.7 or >= 3.2
- Registered Application with WePay production site or it's development clone.
- six.
- requests (optional):
pip install python-wepay
http://python-wepay.readthedocs.org/en/latest/index.html
MIT licensed. See the bundled LICENSE file for more details.