pingpp 文件夹下是 Python SDK 文件,
example 文件夹里面是简单的接入示例,该示例仅供参考。
pip install pingpp
或使用 setup.py 手动安装
python setup.py install
pingpp.api_key = 'APP-KEY'
ch = pingpp.Charge.create(
order_no='123456789',
channel='alipay',
amount=1,
subject='test-subject',
body='test-body',
currency='cny',
app=dict(id='YOUR-APP-ID'),
client_ip='127.0.0.1'
)
pingpp.Charge.retrieve('CHARGE-ID')
pingpp.Charge.all()
ch = pingpp.Charge.retrieve('CHARGE-ID')
re = ch.refunds.create()
ch = pingpp.Charge.retrieve('CHARGE-ID')
re = ch.refunds.retrieve('REFUND-ID')
ch = pingpp.Charge.retrieve('CHARGE-ID')
re = ch.refunds.retrieve('REFUND-ID')
pingpp.RedEnvelope.create()
pingpp.RedEnvelope.retrieve('RED-ID')
pingpp.RedEnvelope.all()
pingpp.Event.retrieve('RED-ID')
pingpp.Event.all()
tr = pingpp.Transfer.create(
order_no='1234567890',
channel='wx_pub',
amount=100,
currency='cny',
app=dict(id='YOUR-APP-ID'),
type='b2c',
recipient='youropenid',
extra=dict(user_name='User Name', force_check=True),
description='description'
)
pingpp.Transfer.retrieve('TR-ID')
pingpp.Transfer.all()
详细信息请参考 API 文档。