允许您访问wallee的SDK

wallee的Python项目详细描述


Build Status

wallee Python库

walleepython库包装了walleeapi。此库方便您与各种服务(如事务、帐户和订阅)的交互。在

文件

wallee Web Service API

要求

  • Python 3.5+

安装

建议安装(EH 3)
pip install --upgrade wallee

通过github从源代码安装pip

^{pr2}$

(您可能需要使用根权限运行pipsudo pip install git+http://github.com/wallee-payment/python-sdk.git

从“安装工具3”源代码安装

通过Setuptools安装。在

python setup.py install

(或sudo python setup.py install为所有用户安装软件包)

使用

库需要配置帐户的空间id、用户id和密钥,这些密钥可在wallee account dashboard中找到。将space_iduser_id和{}设置为它们的值。在

配置服务

fromwalleeimportConfigurationfromwallee.apiimportTransactionServiceApi,TransactionPaymentPageServiceApifromwallee.modelsimportLineItem,LineItemType,TransactionCreatespace_id=405config=Configuration(user_id=512,api_secret='FKrO76r5VwJtBrqZawBspljbBNOxp5veKQQkOnZxucQ=')transaction_service=TransactionServiceApi(configuration=config)transaction_payment_page_service=TransactionPaymentPageServiceApi(configuration=config)

要开始发送事务,请查看以下示例:

fromwalleeimportConfigurationfromwallee.apiimportTransactionServiceApi,TransactionPaymentPageServiceApifromwallee.modelsimportLineItem,LineItemType,TransactionCreatespace_id=405config=Configuration(user_id=512,api_secret='FKrO76r5VwJtBrqZawBspljbBNOxp5veKQQkOnZxucQ=')transaction_service=TransactionServiceApi(configuration=config)transaction_payment_page_service=TransactionPaymentPageServiceApi(configuration=config)# create line itemline_item=LineItem(name='Red T-Shirt',unique_id='5412',sku='red-t-shirt-123',quantity=1,amount_including_tax=29.95,type=LineItemType.PRODUCT)# create transaction modeltransaction=TransactionCreate(line_items=[line_item],auto_confirmation_enabled=True,currency='EUR',)transaction_create=transaction_service.create(space_id=space_id,transaction=transaction)payment_page_url=transaction_payment_page_service.payment_page_url(space_id=space_id,id=transaction_create.id)# redirect your customer to this payment_page_url

许可证

有关详细信息,请参阅license file。在

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
“电话目录”数据结构的java实现   使用PC remote读取JSP页面上的文件时出现java错误   无法在不同目录中从Java执行Python脚本   java无法在windows 8.1上运行javafx应用程序   java航空公司系统如何防止两个用户同时预订同一个座位?   反射如何在java方法中获取每个参数的名称和值?   阅读中的字符串问题。txt文档并在Java中编辑   java JTextPane行包装问题   使用PowerMock Android Junit时出现java ClassNotFoundException   java输入和If语句   java如何在不使用剪贴板或操作CTRL+C、CTRL+V的情况下将字符串中的“\t”或“tab”发送到selenium中的文本框中   tomcat7将Java应用程序部署到Digitalocean中的Tomcat根目录   响应中嵌套映射的java问题(Jersey)