dwolla api v2客户端
dwollaswagger的Python项目详细描述
dwolla-swagger-python
====
新的dwolla-api v2-sdk,由'this fork of
swagger-codegen<;https://github.com/mach kernel/swagger-codegen>;生成;`_.
version
--
<1.0.9
https://pip.pypa.io/en/latest/installing.html>;``通过pip安装:*
::
pip install dwollaswagger
*添加到``requirements.txt``并使其成为您的包的永久依赖项:*
。代码::requirements.txt
yourApp
somelibrary==1.2.3
dwolla swagger>;=1.0.0
:
*直接从源代码安装:*
:
*os x用户可能需要以特权用户的身份运行"setup.py"。
quickstart
----
``dwollaswagger``使开发人员能够轻松地使用我们的api运行
。在尝试以下操作之前,理想情况下应创建
`应用程序密钥和密钥<;https://www.dwolla.com/applications>;` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` `配置客户端
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~您只需要设置"访问令牌"和"主机"的值。代码::python
dwollaswagger.configuration.access\u token='token'
uat/sandbox
client=dwollaswagger.apiclient('https://api uat.dwolla.com')
客户
~~~~~~~~~~~~~~~~~~~~~~~~~
现在我们已经建立了客户机,我们可以使用它向
api发出请求。让我们检索10条与使用的
授权令牌相关联的客户记录。代码::python
dwollaswagger.configuration.access\u token='token'
client=dwollaswagger.apclient('https://api uat.dwolla.com')
customers\u api=dwollaswagger.customersapi(client)
my\u custies=customers\u api.list(limit=10)
`my\u custies``将是由"customer"对象组成的python列表。
代码::python
customers_api=dwollaswagger.customers api(client)
location=customers_api.create(body={
'firstname':"jennifer",
'lastname':"smith",
'email':"jsmith@gmail.com",
"电话":"7188675309"})
代码::python
new_cust=dwollaswagger.createcustomer
new_cust.first_name="jennifer"
new_cust.last_name="smith"
new_cust.email="jsmith@gmail.com"
new_cust.phone="7188675309"
location=customers_api.create(body=new_cust)
``location``将包含新创建资源的URL(http 201
/location header)。
modules
----
``dwolla python swagger``包含允许用户
发出请求,以及
daos<;http s://en.wikipedia.org/wiki/data-access-object>;`` https://en.wikipedia.org/wiki/data-access-api用于序列化响应。
~~~
>每个api模块都是根据(`dwolla's api
spec<;http://docsv2.dwolla.com/>;)命名的`_并封装所有
文档化功能。
-``accountsapi`
-``businessclassificationsapi`
-``customersapi`
-``documentsapi```
-``eventsapi`
-``fundingsourcesapi``
-``rootapi``
-``transfersapi``
-``webhooksapi``
-``webhooksubscriptionsapi``
-
`here<;配置%20a%20client>;`_.
示例
^^^^^^
…代码::python
doc-api=dwollaswagger.documentsapi(您的客户机对象)
models
~~~~~
每个模型代表可以使用dwolla-api发出的不同类型的请求和响应。
-``accountinfo`
-``amount`
-`` applicationEvent``
-``baseobject`
-``businessClassification``
-``businessClassificationListResponse`
-``createCustomer`
-``createFundingSourceQuest`
-``createWebHook`
-``customer`
-``customerListResponse``
-``document`
-`` documentListResponse`
-``EventListResponse`
-``FundingSource`
-``FundingSourceListResponse`
-``HalLink`
-``Money`
-``Transfer`
-``TransferListResponse`
-``TransferrequestBody`
-``Unit`
-``UpdateCustomer`
-``验证肯`
-``verifymicrodepositsrequest`
-``webhook``
-``webhooketrant``
-``webhookventlistresponse``
-``webhookheader`
-``webhookhttprequest`
-``webhookhttpresponse``
-``webhooklistsresponse`
-``webhookretry`
-`` webhookretryrequestlistressponse``
-``webhooksubscription`
readme
----
要使库的readme文件在pypi上显示得很好,我们必须使用`*.rst``文件格式。更改此自述文件时,请使用此工具http://johnmacfallane.net/pandoc/try/>;`
将`*.md``文件转换为`*.rst`,并确保同时更新这两个
文件。
changelog
----
<1.0.9\*api架构,`` customersapi``支持客户搜索,``fundingsourcesapi``中的新softdelete方法。
1.0.8\*api架构已更新,新的``masspaymentsapi``和
``masspaymentitemsapi```。新的``MassPayment``和``MassPaymentitem`
模型。
1.0.7\*API架构已更新,``TransferSapi``有新的端点用于
取消传输并获取传输费用,新的
``OnDemandAuthorizationSapi`。\*现有的``microdeposits``和
``documents``模型更新,新的``facilitatorfeerequest```,
``authorization```和``updatetransfer``模型。
1.0.6\*模型中的修补程序日期时间问题。
<1.0.5\*api架构错误修复,``fundingsource``对象现在有
```嵌入的``键为了解决序列化问题。
1.0.4\*更新了api架构,``customersapi``有新的iav
验证端点。\*更新了现有的"customer"相关模型,新的"verificationtoken"模型。\*(已跳过发行版,1.0.5中的功能)
1.0.3\*更新了API架构,现在添加了"rootAPI"。\*根据
`rfc-6749<;https://tools.ietf.org/html/rfc6749>;``推荐的
命名法,将
`auth`u token`改为``access`u token`。
1.0.2\*api schema更新,``fundingsourcesapi``中的新方法。\*
所有在``path````(例如,
``/resource/{id}`````)中使用自大变量的方法现在都可以传递一个资源url,以便更容易地
使用hal样式的api。\*用于
htp201响应的更惯用的响应逻辑。\*修复readme
1.0.1\*api架构更新、customersapi和transfersapi中的新方法初始版本中的语法错误。
----
http://github.com/mach kernel/swagger codegen>;`\-
`swagger codegen
contributors<;https://github.com/swagger api/swagger codegen/network/members>;`\uu
-`david stancu<;http://github.com/mach kernel>;`\uu
license
----
版权所有2015 Swagger贡献者,David Stancu
根据Apache许可证2.0版("许可证")获得许可;您可以
不使用此文件,除非符合许可证。您可以在http://www.apache.org/licenses/license-2.0
http://www.apache.org/licenses/license-2.0
处获得许可证副本,除非适用法律要求或书面同意,否则根据许可证分发的软件将按"原样"分发,
无担保或条件任何类型,无论是明示的还是暗示的。
请参阅许可证,了解控制许可的特定语言以及许可证下的限制。
====
新的dwolla-api v2-sdk,由'this fork of
swagger-codegen<;https://github.com/mach kernel/swagger-codegen>;生成;`_.
version
--
<1.0.9
https://pip.pypa.io/en/latest/installing.html>;``通过pip安装:*
::
pip install dwollaswagger
*添加到``requirements.txt``并使其成为您的包的永久依赖项:*
。代码::requirements.txt
yourApp
somelibrary==1.2.3
dwolla swagger>;=1.0.0
:
*直接从源代码安装:*
:
*os x用户可能需要以特权用户的身份运行"setup.py"。
quickstart
----
``dwollaswagger``使开发人员能够轻松地使用我们的api运行
。在尝试以下操作之前,理想情况下应创建
`应用程序密钥和密钥<;https://www.dwolla.com/applications>;` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` `配置客户端
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~您只需要设置"访问令牌"和"主机"的值。代码::python
dwollaswagger.configuration.access\u token='token'
uat/sandbox
client=dwollaswagger.apiclient('https://api uat.dwolla.com')
客户
~~~~~~~~~~~~~~~~~~~~~~~~~
现在我们已经建立了客户机,我们可以使用它向
api发出请求。让我们检索10条与使用的
授权令牌相关联的客户记录。代码::python
dwollaswagger.configuration.access\u token='token'
client=dwollaswagger.apclient('https://api uat.dwolla.com')
customers\u api=dwollaswagger.customersapi(client)
my\u custies=customers\u api.list(limit=10)
`my\u custies``将是由"customer"对象组成的python列表。
代码::python
customers_api=dwollaswagger.customers api(client)
location=customers_api.create(body={
'firstname':"jennifer",
'lastname':"smith",
'email':"jsmith@gmail.com",
"电话":"7188675309"})
代码::python
new_cust=dwollaswagger.createcustomer
new_cust.first_name="jennifer"
new_cust.last_name="smith"
new_cust.email="jsmith@gmail.com"
new_cust.phone="7188675309"
location=customers_api.create(body=new_cust)
``location``将包含新创建资源的URL(http 201
/location header)。
modules
----
``dwolla python swagger``包含允许用户
发出请求,以及
daos<;http s://en.wikipedia.org/wiki/data-access-object>;`` https://en.wikipedia.org/wiki/data-access-api用于序列化响应。
>每个api模块都是根据(`dwolla's api
spec<;http://docsv2.dwolla.com/>;)命名的`_并封装所有
文档化功能。
-``accountsapi`
-``businessclassificationsapi`
-``customersapi`
-``documentsapi```
-``eventsapi`
-``fundingsourcesapi``
-``rootapi``
-``transfersapi``
-``webhooksapi``
-``webhooksubscriptionsapi``
-
示例
^^^^^^
…代码::python
doc-api=dwollaswagger.documentsapi(您的客户机对象)
models
~~~~~
每个模型代表可以使用dwolla-api发出的不同类型的请求和响应。
-``accountinfo`
-``amount`
-`` applicationEvent``
-``baseobject`
-``businessClassification``
-``businessClassificationListResponse`
-``createCustomer`
-``createFundingSourceQuest`
-``createWebHook`
-``customer`
-``customerListResponse``
-``document`
-`` documentListResponse`
-``EventListResponse`
-``FundingSource`
-``FundingSourceListResponse`
-``HalLink`
-``Money`
-``Transfer`
-``TransferListResponse`
-``TransferrequestBody`
-``Unit`
-``UpdateCustomer`
-``验证肯`
-``verifymicrodepositsrequest`
-``webhook``
-``webhooketrant``
-``webhookventlistresponse``
-``webhookheader`
-``webhookhttprequest`
-``webhookhttpresponse``
-``webhooklistsresponse`
-``webhookretry`
-`` webhookretryrequestlistressponse``
-``webhooksubscription`
readme
----
要使库的readme文件在pypi上显示得很好,我们必须使用`*.rst``文件格式。更改此自述文件时,请使用此工具http://johnmacfallane.net/pandoc/try/>;`
将`*.md``文件转换为`*.rst`,并确保同时更新这两个
文件。
changelog
----
<1.0.9\*api架构,`` customersapi``支持客户搜索,``fundingsourcesapi``中的新softdelete方法。
1.0.8\*api架构已更新,新的``masspaymentsapi``和
``masspaymentitemsapi```。新的``MassPayment``和``MassPaymentitem`
模型。
1.0.7\*API架构已更新,``TransferSapi``有新的端点用于
取消传输并获取传输费用,新的
``OnDemandAuthorizationSapi`。\*现有的``microdeposits``和
``documents``模型更新,新的``facilitatorfeerequest```,
``authorization```和``updatetransfer``模型。
1.0.6\*模型中的修补程序日期时间问题。
<1.0.5\*api架构错误修复,``fundingsource``对象现在有
```嵌入的``键为了解决序列化问题。
1.0.4\*更新了api架构,``customersapi``有新的iav
验证端点。\*更新了现有的"customer"相关模型,新的"verificationtoken"模型。\*(已跳过发行版,1.0.5中的功能)
1.0.3\*更新了API架构,现在添加了"rootAPI"。\*根据
`rfc-6749<;https://tools.ietf.org/html/rfc6749>;``推荐的
命名法,将
`auth`u token`改为``access`u token`。
1.0.2\*api schema更新,``fundingsourcesapi``中的新方法。\*
所有在``path````(例如,
``/resource/{id}`````)中使用自大变量的方法现在都可以传递一个资源url,以便更容易地
使用hal样式的api。\*用于
htp201响应的更惯用的响应逻辑。\*修复readme
1.0.1\*api架构更新、customersapi和transfersapi中的新方法初始版本中的语法错误。
http://github.com/mach kernel/swagger codegen>;`\-
`swagger codegen
contributors<;https://github.com/swagger api/swagger codegen/network/members>;`\uu
-`david stancu<;http://github.com/mach kernel>;`\uu
license
----
版权所有2015 Swagger贡献者,David Stancu
根据Apache许可证2.0版("许可证")获得许可;您可以
不使用此文件,除非符合许可证。您可以在http://www.apache.org/licenses/license-2.0
http://www.apache.org/licenses/license-2.0
处获得许可证副本,除非适用法律要求或书面同意,否则根据许可证分发的软件将按"原样"分发,
无担保或条件任何类型,无论是明示的还是暗示的。
请参阅许可证,了解控制许可的特定语言以及许可证下的限制。