V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
chengxiao
V2EX  ›  Python

请教各位大佬,有没有微信支付的 Django 案例?

  •  
  •   chengxiao · 2017-11-13 15:05:51 +08:00 · 4927 次点击
    这是一个创建于 2328 天前的主题,其中的信息可能已经有所发展或是发生改变。
    在写一个公众号的小玩意,不过在微信支付这里碰到坑了....
    7 条回复    2018-07-02 09:16:39 +08:00
    zhengxiaowai
        1
    zhengxiaowai  
       2017-11-13 15:15:01 +08:00
    有,前年做过。。。
    unknowfly
        2
    unknowfly  
       2017-11-13 15:23:56 +08:00
    用 wechatpy 的话应该没有什么坑吧
    chengxiao
        3
    chengxiao  
    OP
       2017-11-13 15:51:42 +08:00
    @zhengxiaowai 可以参考一下么?
    Macuilxochitl
        4
    Macuilxochitl  
       2017-11-13 16:43:45 +08:00
    可以用 weixin-python,前两天才用 tornado 和它做了微信支付的功能
    https://github.com/zwczou/weixin-python
    chengxiao
        5
    chengxiao  
    OP
       2017-11-15 11:09:55 +08:00
    @Macuilxochitl 可以给个代码示例么?主要是搞不清楚整个流程,怎么发起支付求情....
    Macuilxochitl
        6
    Macuilxochitl  
       2017-11-15 17:20:08 +08:00
    @chengxiao
    import weixin-python
    pay = WeixinPay(appid,微信商户 id,微信商户 KEY,微信回调地址)
    order_string = pay.unified_order(trade_type=支付方式,product_id=商品 ID, body=标题, out_trade_no=订单号, total_fee=金额, attach=额外信息)
    如果你填的东西正确,order_string 就是微信给你返回的东西,比如选择二维码付款的话就会给你返回二维码链接
    haoji
        7
    haoji  
       2018-07-02 09:16:39 +08:00
    https://github.com/mrhaoji/django-wechat-pay

    Django + wechatpy 做的微信小程序端微信支付 demo
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5237 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 09:15 · PVG 17:15 · LAX 02:15 · JFK 05:15
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.