Giter Site home page Giter Site logo

Comments (7)

tg123 avatar tg123 commented on May 23, 2024

支付相关代码是我贡献的
我这边有个项目 实际使用 werobot 的
支付相关代码也是一致的

那个时候还没有微小店 现在好像有小店 API
不过我没有用到

如果你遇到问题 可以给提 issue 的

from werobot.

aka99 avatar aka99 commented on May 23, 2024

看了源码,有几个问题请教:
1、不知道是否微信支付版本差异,现在的接口地址变了,参数也不同了,详见http://pay.weixin.qq.com/wiki/doc/api/index.php
2、是否支持JsApi 场景发起支付

谢谢

from werobot.

tg123 avatar tg123 commented on May 23, 2024

1 目前 我的应用还可以用
2 支持 我的应用就是通过jsapi 发起的

from werobot.

aka99 avatar aka99 commented on May 23, 2024

谢谢!
如果用JsApi发起支付,WeixinPayClient 大致操作思路能否指点一下?

from werobot.

tg123 avatar tg123 commented on May 23, 2024

大致流程代码 我贴下 删减了 可能不能直接运行

首先 网页段发起 创建请求 把创建订单 必要的参数传递给后端

                $.post('/pay/create', {
                    item_id : {{id}}
                }).success(function(data){
                    WeixinJSBridge.invoke('getBrandWCPayRequest', data, function(res){
                        if(res.err_msg == "get_brand_wcpay_request:ok"){
                            alert("购买成功");
                        }
                        WeixinJSBridge.log(res.err_msg);
                    });

服务器端生成 js 需要的 数据 对应上端代码中的 data , pay_params 就是 data
用来创建订单的

    pay_params = wxclient.create_js_pay_params(body=商品名称,
                                               out_trade_no=外部订单号, total_fee=价格分,
                                               notify_url=回调地址,
                                               spbill_create_ip=request.environ.get('REMOTE_ADDR'), )

from werobot.

aka99 avatar aka99 commented on May 23, 2024

谢谢耐心答复。
因用的微信支付3.3.7接口,目前还没用微信支付组件,使用比较笨办法实现了支付。

from werobot.

aetherwu avatar aetherwu commented on May 23, 2024

能否请问一下怎么获取 wxclient? 谢谢……

from werobot.

Related Issues (20)

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.