The official reversly api client
gc-recurl的Python项目详细描述
recurly的python客户端库是其REST API的接口。
python版本
此库支持的最低要求是:
- python>;=2.7.9
- openssl>;=1.0.1
配置
设置您的API密钥,并可以选择设置证书颁发机构证书文件和默认货币:
import recurly recurly.SUBDOMAIN = 'your-subdomain' recurly.API_KEY = '012345678901234567890123456789ab' # Set a certificate authority certs file to validate Recurly's certificate recurly.CA_CERTS_FILE = '/etc/pki/tls/certs/ca-bundle.crt' # Set a default currency for your API requests recurly.DEFAULT_CURRENCY = 'USD'
递归python客户端测试
要在Python2.7中运行这些测试,请使用unittest测试运行程序:
$ python -m unittest discover -s tests
在python 2.6或更早版本下,安装unittest2发行版并使用它 相反:
$ pip install unittest2 # or easy_install $ python -m unittest2 discover -s tests
test_resources.py中的资源测试将使用 测试/固定装置。要对活动的递归api端点运行测试, 配置重复测试帐户并在 循环API键环境变量:
$ RECURLY_API_KEY=1274…54e3 python -m unittest tests.test_resources
在验证服务器时,还可以测试live recurly api端点。 带有recurly_ca_certs_文件的证书 是连接的证书颁发机构x.509证书的文件名:
$ RECURLY_API_KEY=1274…54e3 RECURLY_CA_CERTS_FILE=/etc/pki/tls/certs/ca-bundle.crt -m unittest tests.test_resources
用法
请参阅Recurly API了解更多信息。
IRC
如果您对库或集成有一般性问题,您可以在freenode网络上的recurly irc频道找到我们中的一些人。