Giter Site home page Giter Site logo

flask-wxpay's Introduction

微信支付Flask扩展

文档

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.