Skip to main content

Python pay library: alipay, wechat, etc.

Project description

py-pay

Python pay library.

pip install -U py-pay

微信支付

from py_pay.wechat import WechatPay
wechat_conf = {
    'app_id': 'appid',
    'mch_id': '商户号',
    'key': '签名key',
    # 需要双向证书的配置下面两行
    # 'cert_file': '/path/to/cert_file',
    # 'cert_key': '/path/to/cert_key',
}
wechat_pay = WechatPay(**wechat_conf)

# 示例
params = {'foo': 'bar'}
wechat_pay.unifiedorder(params)  # 统一下单
wechat_pay.orderquery(params)  # 查询订单
wechat_pay.closeorder(params)  # 关闭订单
wechat_pay.refund(params)  # 申请退款
wechat_pay.refundquery(params)  # 退款查询
wechat_pay.pay_notify(request.body)  # 支付通知
wechat_pay.response(False, '签名失败')  # 支付通知

wechat_pay.promotion_transfers(params)  # 企业付款

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py-pay-1.3.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

py_pay-1.3.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file py-pay-1.3.0.tar.gz.

File metadata

  • Download URL: py-pay-1.3.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

File hashes

Hashes for py-pay-1.3.0.tar.gz
Algorithm Hash digest
SHA256 13db73ecc53685261f436cda40824e9aa8720f3e2f22bb70bfc3c5c16dc57292
MD5 bef681452c215ca104821df0f7143e53
BLAKE2b-256 4d8065b83fec395952b05edf301940b4a7fa0c247b6269ea39dc02d49918625d

See more details on using hashes here.

File details

Details for the file py_pay-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: py_pay-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

File hashes

Hashes for py_pay-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 78c1f9fcaa7dbfc97484c46de3274540a85695556e76ae6878282e4bf97b17fb
MD5 04a5073555911a3345738d621e383571
BLAKE2b-256 bafddaf182661091a15c20eb7027ce4d7aeb1e0f3515c4365d5de3d84587e546

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page