跳转到主要内容

为paylike.io的REST API提供的Python包装器

项目描述

paylike-python-sdk

Paylike.io rest api的Python实现

限制

仅实现了交易管理部分,您可以在以下位置找到官方API文档:[链接](https://github.com/paylike/api-docs#transactions)

基本用法

client = PaylikeApiClient(api_key, merchant_id)

方法

cancel_transaction

'''
Void or partially void the reserved amount on a transaction
  - transactionId: String,      // required
  - amount: Decimal,            // If no amount is given, the full amount will be voided
'''
client.cancel_transaction(transaction_id, amount=None)

capture_transaction

'''
Capture a transaction
  - transactionId: String,      // required
  - amount: Decimal,            // required
  - descriptor: String,         // optional, text on client bank statement
  - currency: String,           // optional, expected currency (for additional verification)
'''
client.capture_transaction(transaction_id, amount, descriptor='', currency=None)

create_payment_from_transaction

请确保阅读有关周期性支付的说明。

'''
Create a payment, based on an existing transaction (used for recurring payments)
  - transactionId: String,      // required
  - currency: String,           // required, three letter ISO
  - amount: Decimal,            // required, amount in minor units
  - descriptor: String,         // optional, the statement on the customers bankaccount. Will fallback to merchant descriptor
'''
client.create_payment_from_transaction(transaction_id, currency, amount, descriptor='')

create_payment_from_saved_card

请确保阅读有关周期性支付的说明。建议使用create_payment_from_transaction。

'''
Create a payment from a saved card token
  - cardId: String,             // required
  - currency: String,           // required, three letter ISO
  - amount: Decimal,            // required
  - descriptor: String,         // optional, the statement on the customers bankaccount. Will fallback to merchant descriptor
'''
client.create_payment_from_saved_card(card_id, currency, amount, descriptor='')

get_transaction

'''
Fetch a transaction
  - transactionId: String,      // required
'''
client.get_transaction(transaction_id)

get_transactions

'''
Fetch transactions
  - limit: Number,              // optional, the number of transactions to fetch. Default 100
'''
client.get_transactions(limit=100)

refund_transaction

'''
Refund, or partially refund a transaction
  - transactionId: String,      // required
  - amount: Decimal,            // required
  - descriptor: String,         // optional, the statement on the customers bankaccount. Will fallback to merchant descriptor
'''
client.refund_transaction(self, transaction_id, amount, descriptor="")

'''

项目详情


下载文件

下载适用于您的平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分布

paylike-1.0.tar.gz (3.2 kB 查看哈希值)

上传时间 源代码

构建版本

paylike-1.0-py3-none-any.whl (3.9 kB 查看哈希值)

上传时间 Python 3

由以下支持