Skip to content

zhongql/pingpp-python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pingpp Python SDK


简介

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()

查询 event

pingpp.Event.retrieve('RED-ID')

查询 event 列表

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 文档

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%