Python包装桨叶网美国石油学会
paddle-python的Python项目详细描述
此项目已将名称更改为桨式客户端
Github-paddle-client
PyPi-paddle-client
如果您已经安装了旧的padle python,请删除旧的padle python并安装padle客户端,以确保您获得最新的更改,padle python将不再更新
pip uninstall paddle-python pip install paddle-client
下面的自述已经更新以反映上述内容。如果你想看旧版本,请看release 0.5.1 - the last release as paddle-python
围绕Paddle.comAPI的python(3.5+)包装器
如果您正在查看集成桨与Django检查dj-paddle
注意:这是一个正在进行的工作,并不是所有的桨叶端点都已经实现
快速入门
安装
^{pr2}$用法
要使用padle API,您需要一个桨叶供应商ID和API密钥,可以在Paddle's authentication page上找到
frompaddleimportPaddleClientpaddle=PaddleClient(vendor_id=12345,api_key='myapikey')paddle.list_products()
如果vendor_id
和api_key
没有通过,初始化时,padle将返回并尝试使用名为PADDLE_VENDOR_ID
和PADDLE_API_KEY
的环境变量
exportPADDLE_VENDOR_ID=12345exportPADDLE_API_KEY="myapikey"
frompaddleimportPaddleClientpaddle=PaddleClient()paddle.list_products()
文件
马上就来。有关基本用法,请参见下面的Working endpoints
。在
贡献
欢迎并感谢所有的贡献。请参阅CONTRIBUTING.md获取更多详细信息,包括如何运行测试等
工作终结点
- Get Order Details
- Get User History
- Get Prices
- List Coupons
- Create Coupon
- Delete Coupon
- Update Coupon
- List Products
- List Transactions
- Refund Payment
- List Plans
- Create Plan
- List Subscription Users
- Cancel Subscription
- Update Subscription
- Preview Subscription Update
- Get Webhook History
paddle.get_order_details(checkout_id=checkout_id)paddle.get_user_history(email=email)paddle.get_prices(product_ids=[product_id])paddle.list_coupons(product_id=product_id)paddle.create_coupon(coupon_type='product',discount_type='percentage',discount_amount=50,allowed_uses=1,recurring=False,currency='USD',product_ids=product_ids,coupon_code='50%OFF',description='50% off coupon over $10',expires=expires,minimum_threshold=10,group='paddle-python',)paddle.delete_coupon(coupon_code=new_coupon_code,product_id=product_id)paddle.update_coupon(coupon_code=coupon_code,new_coupon_code='40%OFF',new_group='paddle-python-test',product_ids=[product_id],expires=expires,allowed_uses=1,currency='USD',minimum_threshold=10,discount_amount=40,recurring=True)paddle.list_products()paddle.list_transactions(entity='subscription',entity_id=subscription_id)paddle.refund_payment(order_id=order_id,amount=amount,reason=reason)paddle.list_plans()paddle.create_plan(plan_name='plan_name',plan_trial_days=14,plan_length=1,plan_type='month',main_currency_code='USD',initial_price_usd=50,recurring_price_usd=50,)paddle.list_subscription_users()paddle.cancel_subscription(subscription_id=1234)paddle.update_subscription(subscription_id=1234,pause=True)paddle.preview_update_subscription(subscription_id=123,bill_immediately=True,quantity=101,)paddle.get_webhook_history()
失败的终结点
下面的端点已经实现,但是根据测试,它们不能正常工作。它们已在paddle/paddle.py
中注释掉,如果方法不存在,测试将跳过
- Generate License-
Paddle error 108 - Unable to find requested product
- Create pay link-
Paddle error 108 - Unable to find requested product
托多
- 修复生成许可证和创建付费链接端点
- 桨式API端点 在
- 确定是否要包括“alias”方法,如pause\u subscription
- 使测试覆盖率达到100%
- 文档(自动文档?)在
- 使用
pytest-mock
Spy
检查测试请求的参数、json、url等- 由于缺少数据而跳过的任何测试都需要
- 如何处理人工清理?在
- 拉取请求模板
- 特拉维西?在
- 可靠的
- 删除异常错误消息检查的双重调用-如何从
pytest.raises()
获取异常str?pytest模拟Spy
?在 - 添加pytest警告,为需要清理的位提供直接链接
- 项目
标签: