Git Product home page Git Product logo

Comments (38)

xu-li avatar xu-li commented on May 20, 2024

See #23 .

from cordova-plugin-wechat.

jackyon avatar jackyon commented on May 20, 2024

+1

from cordova-plugin-wechat.

jackyon avatar jackyon commented on May 20, 2024

请问微信支付功能预期什么时候能够加入?目前很需要这个功能~谢谢

from cordova-plugin-wechat.

xu-li avatar xu-li commented on May 20, 2024

暂时没计划,因为没有账号来做测试。

from cordova-plugin-wechat.

vitohe avatar vitohe commented on May 20, 2024

@xu-li
hi,我这边可以提供用于开发微信支付的测试账号,如果需要的话给我一个联系方式。

from cordova-plugin-wechat.

clock157 avatar clock157 commented on May 20, 2024

@xu-li 你好,我也获取了微信支付权限,如果需要可以联系我. 83113497

from cordova-plugin-wechat.

xu-li avatar xu-li commented on May 20, 2024

多谢大家。能否发我的邮箱: [email protected]

from cordova-plugin-wechat.

xu-li avatar xu-li commented on May 20, 2024

多谢 @vitohe, @clock157 提供测试帐号。

现在我把微信支付加上去了,见develop分支。我在iOS上测试过,可以成功调用支付。Android上,需要你们的来测试一下,我没有你们的keystore。

安装方法:

cordova plugin add https://github.com/xu-li/cordova-plugin-wechat#develop --variable wechatappid=YOUR_WECHAT_APPID

如果有问题,欢迎发邮件或者留言。

from cordova-plugin-wechat.

WhiteCrowSource avatar WhiteCrowSource commented on May 20, 2024

android上经过测试,点击支付无任何反应

from cordova-plugin-wechat.

xu-li avatar xu-li commented on May 20, 2024

@wangxiqiang 请问分享有作用么?支付的代码你是怎么写的?

from cordova-plugin-wechat.

WhiteCrowSource avatar WhiteCrowSource commented on May 20, 2024

分享,登录都有作用。均正常。先由服务器生成prepayid,nonce,timestamp,sign,然后组成数组抛给webchat.sendPaymentRequest。按理说,不管参数对不对,均可以调起微信端。但现在是没有任何的反应。

$http.get(domain+'/api/order/wxpay/sign/'+$scope.order.orderSn).success(function(result){
    console.log('请求支付返回:'+JSON.stringify(result));
    if (result.status==1){
        var parame={
            mch_id: wechatMchId, // merchant id
            prepay_id: result.data.prepayid, // prepay id
            nonce: result.data.noncestr, // nonce
            timestamp: result.data.timeStamp, // timestamp
            sign: result.data.paySign
        };
        console.log('调支付的参数:'+JSON.stringify(parame));
        Wechat.sendPaymentRequest(parame, function () {
            alert("Success");
        }, function (reason) {
            alert("Failed: " + reason);
        });
    }else{
        alert('失败:'+result.msg);
    }
}).error(function(){
    alert('支付请求失败!')
});

from cordova-plugin-wechat.

ryanlin1986 avatar ryanlin1986 commented on May 20, 2024

+1

from cordova-plugin-wechat.

xu-li avatar xu-li commented on May 20, 2024

@wangxiqiang @ryanlin1986 搞错了app id和open id。现在应该好了。

真不好意思。

from cordova-plugin-wechat.

WhiteCrowSource avatar WhiteCrowSource commented on May 20, 2024

@xu-li 还是无法调起微信。可能服务端和客户端两边的生成签名的参数大小写的问题。待查实后再反馈

from cordova-plugin-wechat.

goneaway1981 avatar goneaway1981 commented on May 20, 2024

你好,我尝试用VS2015+Cordova添加微信的分享插件,然后编译会报错,
错误 version not found: 0.8.0 : xu.li.cordova.wechat/0.8.0 AngularJSToDo F:\00_Work1\05.Test\13-Cordova\AngularJSToDo\AngularJSToDo\MDAVSCLI 1
不知道这个错误是什么原因导致的?我完全是个新手,不胜感谢

from cordova-plugin-wechat.

xu-li avatar xu-li commented on May 20, 2024

@goneaway1981 不好意思,没用过VS2015。

from cordova-plugin-wechat.

zhougn avatar zhougn commented on May 20, 2024

android点支付无反应的估计是因为没有在微信开放平台绑定应用签名
http://fangjie.info/android微信支付/

@xu-li 虽然android能正常支付,但是完成后没有调用callback,这是个bug吗?iOS正常。

from cordova-plugin-wechat.

xu-li avatar xu-li commented on May 20, 2024

@zhougn 应该是bug。请问:

  1. 支付完成后,回到你的app了么?
  2. 你调用其它API(比如分享),callback正常么?

多谢测试。

from cordova-plugin-wechat.

zhougn avatar zhougn commented on May 20, 2024
  1. 支付完成能正常回到app
  2. Wechat.auth的callback正常

from cordova-plugin-wechat.

Huikit avatar Huikit commented on May 20, 2024

可以请问如何获取签名 统一下单的方法吗?

from cordova-plugin-wechat.

ryanlin1986 avatar ryanlin1986 commented on May 20, 2024

@xu-li 我也有和@zhougn同样的问题,支付成功以后点击完成, 微信管比可以正常回到app,但是callback并没有调用。

from cordova-plugin-wechat.

ryanlin1986 avatar ryanlin1986 commented on May 20, 2024

@xu-li 补充下, 进入微信支付页面以后,直接按返回键关闭微信支付界面回到app以后,失败callback也没被调用。

from cordova-plugin-wechat.

ryanlin1986 avatar ryanlin1986 commented on May 20, 2024

@xu-li 看了下微信sdk demo,目录下的请先阅读这里.txt有这么一句:
要保证回调类WXPayEntryActivity.java文件必须位于包名的wxapi目录下,否则会导致无法回调的情况,注意:此条仅仅适用于android,ios有固定格式,请参考ios demo。

是否这是导致回掉不成功的原因?

from cordova-plugin-wechat.

ryanlin1986 avatar ryanlin1986 commented on May 20, 2024

android可以支付(虽然没回调),iOS启动微信以后,界面是空白,中间显示“确定”按钮,只能点确定,点击以后关闭微信回到原界面,取消回调有调用到。
环境:cordova 5.1.1.1, 需要做特殊处理吗?

from cordova-plugin-wechat.

xu-li avatar xu-li commented on May 20, 2024

@ryanlin1986 不确定android的问题,我明天看一下。

ios界面空白,基本是你的参数错误,后台代码可以参照这里

from cordova-plugin-wechat.

xu-li avatar xu-li commented on May 20, 2024

@Huikit 参照这里的PHP实现,或者官方文档.

from cordova-plugin-wechat.

Huikit avatar Huikit commented on May 20, 2024

@xu-li 感谢 已经成功 继续支持插件开发

from cordova-plugin-wechat.

xu-li avatar xu-li commented on May 20, 2024

@ryanlin1986 你是对的。微信支付的回调竟然和分享的回调用的不是同一个Activity。

多谢 @zhougn@ryanlin1986 提供测试。

from cordova-plugin-wechat.

ryanlin1986 avatar ryanlin1986 commented on May 20, 2024

@xu-li 经测试android版已经回调已经成功,非常感谢!

from cordova-plugin-wechat.

ryanlin1986 avatar ryanlin1986 commented on May 20, 2024

请问大家有在iOS上成功发起过支付的吗?
android下可以,iOS总是打开微信以后空白背景只有一个确定按钮。
确定用的参数是android iOS完全一样(服务端返回)。

from cordova-plugin-wechat.

ryanlin1986 avatar ryanlin1986 commented on May 20, 2024

不好意思问题已解决,
时间戳我弄成毫秒了,android上正常,实际上应该用秒,android,ios都OK了。

from cordova-plugin-wechat.

BBPen avatar BBPen commented on May 20, 2024

https://api.mch.weixin.qq.com/pay/unifiedorder,这个接口我是在客户端请求的,这样会影响正常支付吗?
iOS总是打开微信以后空白背景只有一个确定按钮。因为没有服务端notify_url这个参数填随便填的“http://localhost”,不知道什么原因导致的不能支付请求帮助 @xu-li

from cordova-plugin-wechat.

xu-li avatar xu-li commented on May 20, 2024

@BBPen **http://localhost**肯定是可以的,我的[DEMO](https://github.com/xu-li/cordova-plugin-wechat-example/blob/master/server/payment_demo.php)用的也是这个。具体是否可以在客户端请求unifiedorder API,这个你要问微信官方,在服务端请求肯定是可以的。

回到空白页面的问题,基本是参数问题。你可以参考这个帖子前面几个回复。

from cordova-plugin-wechat.

BBPen avatar BBPen commented on May 20, 2024

var url = "https://api.mch.weixin.qq.com/pay/unifiedorder";
var timestamp = Date.parse(new Date()) / 1000;
var ip = "120.35.43.34";
var stringA = 'appid=wx79485d7b9f5a8896&body=APP支付测试&mch_id=1330075661&nonce_str=' + timestamp + '&notify_url=http://localhost&out_trade_no=' + timestamp + 'pa&spbill_create_ip=' + ip + '&total_fee=1&trade_type=APP&key=有正确的key';
var sign = md5(stringA).toLocaleUpperCase();
$http({
method: 'post',
url: url,
headers: {
"Content-Type": 'application/xml',
"Accept": "application/json;charset=utf-8",
"Accept-Charset": "charset=utf-8"
},
data: "" +
"wx79485d7b9f5a9996" +
"<mch_id>1330075661</mch_id>" +
"<nonce_str>" + timestamp + "</nonce_str>" +
"APP支付测试" +
"<out_trade_no>" + timestamp + "pa</out_trade_no>" +
"<total_fee>1</total_fee>" +
"<spbill_create_ip>" + ip + "</spbill_create_ip>" +
"<notify_url>http://localhost</notify_url>" +
"<trade_type>APP</trade_type>" +
"" + sign + "" +
""
}).success(function (data) {
console.log(data)
var prepay = data.slice(data.indexOf('<prepay_id></prepay_id>'))
var params = {
partnerid: '1330075661', // merchant id
prepayid: prepay, // prepay id
noncestr: timestamp + 'pa', // nonce
timestamp: timestamp, // timestamp
sign: sign, // signed string
};
Wechat.sendPaymentRequest(params, function () {
alert("Success");
}, function (reason) {
console.log("失败")
console.log(reason)
//支付失败
//$scope.createTable();
});
}
)
接口返回值:
<return_code></return_code>
<return_msg></return_msg>

<mch_id></mch_id>
<nonce_str></nonce_str>

<result_code></result_code>
<prepay_id></prepay_id>
<trade_type></trade_type>

请问有传参错误吗? @xu-li

from cordova-plugin-wechat.

xu-li avatar xu-li commented on May 20, 2024

@BBPen 你的sign重复用了?sign要生成两次,第一次是调用unified api之前,第二次是对有prepayid的map。你可以看我的demo

from cordova-plugin-wechat.

BBPen avatar BBPen commented on May 20, 2024

问题解决了 @xu-li

from cordova-plugin-wechat.

BBPen avatar BBPen commented on May 20, 2024

cordova run android --release --device的时候,手机上弹出包解析错误。
控制台:Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]
ant文件内容:
key.store=/Users/chenpl/papadianyingyuan.keystore
key.alias=papadianyingyuan
key.store.password=zichuangdepapa
key.alias.password=zichuangdepapa
@xu-li 请帮忙看下是签名错了吗?

from cordova-plugin-wechat.

xu-li avatar xu-li commented on May 20, 2024

@BBPen 不知道,你可以google一下,比如这个结果

from cordova-plugin-wechat.

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.