Skip to main content

The Python client library for the GoCardless API

Project description

https://s3-eu-west-1.amazonaws.com/gocardless/images/client-lib-headers/python-lib-header.png

This module provides a wrapper around the GoCardless payments API, the interface to the api is provided by the gocardless.Client object. See the documentation for that class for how to obtain an instance.

By default the library will attempt to use the GoCardless production environment, for testing purposes this is not what you want and you should set the gocardless.environment to “sandbox”.:

>>> gocardless.environment = "sandbox"

Set your account details::

>>> gocardless.set_details(app_id="kzCOPw2JtJvRQxKOPEREQTGvxLvkoMS1Eb0Dgl5QVc1W0NKpOEZDvESfGOI_kkG2l",
>>>     app_secret="IO9AlgPsbYNCtFlcOFGROBrGB3Mi07PFYSn2zx4uK5xaWJI1AzwnYeC86x46ji_g",
>>>     access_token="5EFkzOrUOZ8t+iaP86NggIy+FOFSD0f7QMnMd+Q3P4mQk17Kzq9G1vYrNlEWFldlg",
>>>     merchant_id="02FX1YFDAS")

You can now use the gocardless.client object to generate urls for receiving payments.:

>>> gocardless.client.new_bill_url(10)

Users who click on this link will be taken to the GoCardless website to make a payment to your account.

You can also use it to query the api for information about payments resources using an active resource style API. For example, to get all of a merchants bills:

>>> merchant = client.merchant()
>>> merchant.bills()
>>> [<gocardless.resources.Bill at 0x29a6050>]

Contribute

Fork the repo then clone it to your machine and install in “develop” mode (preferably using a virtualenv):

mkvirtualenv gocardless
git clone https://github.com/<username>/gocardless-python
cd gocardless-python
python setup.py develop

Install the testing dependencies:

pip install -r requirements.txt

and run the test suite:

nosetests

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

gocardless-0.3.0.tar.gz (21.3 kB view details)

Uploaded Source

File details

Details for the file gocardless-0.3.0.tar.gz.

File metadata

  • Download URL: gocardless-0.3.0.tar.gz
  • Upload date:
  • Size: 21.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for gocardless-0.3.0.tar.gz
Algorithm Hash digest
SHA256 1cdd52f50337e05128f7f777d8ac759dbb11eddf1416209e0ebb135c132e76c0
MD5 210e837cf5b79543ec79ee2f4220b14d
BLAKE2b-256 51070ce040cccb86f093a5dc0cdaa4e0d5e6007f3221b43b569a28ec3a6e686f

See more details on using hashes here.

Supported by

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