Arcus API客户端

arcus的Python项目详细描述


Python弧线

Build StatusCoverage StatusPyPI

arcus python3.6+3.7客户端库,用于api版本3.1的Arcus

安装

$ pip install arcus

测试

$ make test

身份验证和帐户信息

当前版本支持直接端点调用。

fromarcus.clientimportClient# Create an Arcus client instanceclient=Client('your-api-key','your-secret-key')# Get account info account_info=client.get('/account')# create bill account_info=dict(biller_id=40,account_number='501000000007')bill=client.post('/bills',account_info)

付账单

fromarcusimportClientclient=Client('your-api-key','your-secret-key')# create billbill=client.bills.create(40,'501000000007')# pay billtransaction=bill.pay()# show transactiontransaction=client.transactions.get(transaction.id)# cancel transactioncancellation=transaction.cancel()assertcancellation['code']=='R0'assertcancellation['message']=='Transaction successful'# verify cancellationupdated_transaction=client.transactions.get(transaction.id)assertupdated_transaction.id==transaction.idassertupdated_transaction.status=='refunded'

加满

fromarcusimportClientclient=Client('your-api-key','your-secret-key')biller_id=808080phone_number='5599992222'amount=100.0# by default, currency is MXNtopup=client.topups.create(biller_id,phone_number,amount)asserttopup.bill_amount==100.0

账单列表

您可以在特定字段中列出所有活动的帐单或筛选器

fromarcus.clientimportClient# Create an Arcus client instanceclient=Client('your-api-key','your-secret-key')# Get all billers in Mexico which use MXN as currencymx_biller_list=client.biller.list(country='MX',currency='MXN')# Get all billers with an specific biller_typeelectricity_biller_list=client.biller.list(biller_type='Electricity')

发布到pypi

  1. setup.py
  2. 中更新版本
  3. 提交对setup.py的更改并推送到origin/master
  4. git tag -a <version> -m <release message>
  5. git push origin --tags

travisci将在验证测试后将更新的版本发布到pypi 通过。

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

推荐PyPI第三方库


热门话题
java开关大小写不返回字符串   java消除Pascals三角形上的前导空格   当用户更改单元格时,仅当用户   调试时,java“this”在片段中不可用   JavaJSFDataTable“优雅”地编辑行内容   java Javafx组合框自动完成返回错误   数组如何在java中将数据从firebase加载到arraylist   java的html问题。木卫一。在浏览器上打印多个空格时使用PrintWriter   java如何在后台下载文件,而不考虑应用程序的状态?   java如何在Eclipse中设置实例断点?   java N1QL二级索引不使用参数化IN子句   多线程在Java中干净地停止线程侦听serversocket   java如何在selenium服务器上检查测试问题   java Hibernate查询。executeUpdate()执行许多查询   java如何从Jenkins文件传递多个参数,如env、凭证、cucumber标记   java保护从子类的子类访问成员