pingpp 文件夹下是 Python SDK 文件,
example 文件夹里面是简单的接入示例,该示例仅供参考。
pip install pingpp
或使用setup.py手动安装
python setup.py install
// 导入pingpp模块
import pingpp
// 设置API-KEY
pingpp.api_key = 'API-KEY'chs = pingpp.Charge.all()ch = pingpp.Charge.retrieve(id='CHARGE-ID', expand='app')ch = pingpp.Charge.create(
order_no='1234567890',
amount=1,
app=dict(id='APP-ID'),
channel='upmp',
currency='cny',
client_ip='CLIENT-IP',
subject='test-subject',
body='test-body',
metadata=dict(color='red')
)ch = pingpp.Charge.create(
order_no='1234567890',
amount=1,
app=dict(id='APP-ID'),
channel='upmp',
currency='cny',
client_ip='CLIENT-IP',
subject='test-subject',
body='test-body',
)ch = pingpp.Charge.retrieve('CHARGE-ID')ch = pingpp.Charge.retrieve('CHARGE-ID')
re = ch.refunds.create(description='desc', amount=1)ch = pingpp.Charge.retrieve('CHARGE-ID')
re = ch.refunds.retrieve('REFUND-ID')ch = pingpp.Charge.retrieve('CHARGE-ID')
res = ch.refunds.all(limit=3)