Skip to main content

文档

帮助文档: 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

WXPAY_SANDBOX

是否使用沙箱环境,默认为 False

Metadata

Release files for Flask-WXPay 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Flask-WXPay 1.0.5
File Size Uploaded
Flask-WXPay-1.0.5.tar.gz 6.8 kB Details

Release files / Flask-WXPay-1.0.5.tar.gz

Download URL Flask-WXPay-1.0.5.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3d1d85a39f6536fb16167fefe33582dbf6b6c33f85205404f514420953f7f0c7
BLAKE2b-256 checksum
How to use checksums
fb35f316188ca9741c1af056c3d316eaecbfa214440382d07e4a576f262148b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

Release history Release notifications | RSS feed

This release

1.0.5 This release

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.1.15

1 release file

0.1.14

1 release file

0.1.13

1 release file

0.1.12

1 release file

0.1.11

1 release file

0.1.10

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page