Skip to main content

Flask Extension for WeChat Pay.

Project description

文档

帮助文档: http://flask-wxpay.readthedocs.io/en/latest/

使用

initialized:

from flask_wxpay import WXPay
wxpay = WXPay()
wxpay.init_app(app)

创建订单,生成prepay data:

from flask_wxpay import now_str
from core import wxpay

out_trade_no = now_str()
order_data = wxpay.unified_order(out_trade_no, total_fee, ip, body, openid=openid)
prepay_data = wxpay.get_jsapi_prepay_data(order_data['prepay_id'])

配置项

WXPAY_BASE_URL

默认值: https://api.mch.weixin.qq.com

WXPAY_REQUEST_TIMEOUT

默认值: 10

WX_APPID

公众账号ID

WXPAY_MCHID

商户号

WXPAY_KEY

商户支付密钥Key

WXPAY_NOTIFY_URL

默认异步通知url

WXPAY_ROOTCA_PATH

rootca证书路径,对应requests的verify参数,默认为None

WXPAY_APICLIENT_CERT_PATH

客户端证书路径,默认值None

WXPAY_APICLIENT_KEY_PATH

客户端证书key的路径,默认值None

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

Flask-WXPay-0.1.15.tar.gz (6.2 kB view details)

Uploaded Source

File details

Details for the file Flask-WXPay-0.1.15.tar.gz.

File metadata

  • Download URL: Flask-WXPay-0.1.15.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6

File hashes

Hashes for Flask-WXPay-0.1.15.tar.gz
Algorithm Hash digest
SHA256 28d908369730f5f794d10913cdb64e0841dbdb00eecea17a65c9e7a54e4c807c
MD5 fe61c8641072d0191c697ee6c9f663fa
BLAKE2b-256 da1ad3927a22efdf74150c6119c628694fee330282969bd34a92f451180362b2

See more details on using hashes here.

Supported by

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