Comments (38)
See #23 .
from cordova-plugin-wechat.
+1
from cordova-plugin-wechat.
请问微信支付功能预期什么时候能够加入?目前很需要这个功能~谢谢
from cordova-plugin-wechat.
暂时没计划,因为没有账号来做测试。
from cordova-plugin-wechat.
@xu-li
hi,我这边可以提供用于开发微信支付的测试账号,如果需要的话给我一个联系方式。
from cordova-plugin-wechat.
@xu-li 你好,我也获取了微信支付权限,如果需要可以联系我. 83113497
from cordova-plugin-wechat.
多谢大家。能否发我的邮箱: [email protected]。
from cordova-plugin-wechat.
现在我把微信支付加上去了,见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.
android上经过测试,点击支付无任何反应
from cordova-plugin-wechat.
@wangxiqiang 请问分享有作用么?支付的代码你是怎么写的?
from cordova-plugin-wechat.
分享,登录都有作用。均正常。先由服务器生成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.
+1
from cordova-plugin-wechat.
@wangxiqiang @ryanlin1986 搞错了app id和open id。现在应该好了。
真不好意思。
from cordova-plugin-wechat.
@xu-li 还是无法调起微信。可能服务端和客户端两边的生成签名的参数大小写的问题。待查实后再反馈
from cordova-plugin-wechat.
你好,我尝试用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.
@goneaway1981 不好意思,没用过VS2015。
from cordova-plugin-wechat.
android点支付无反应的估计是因为没有在微信开放平台绑定应用签名
http://fangjie.info/android微信支付/
@xu-li 虽然android能正常支付,但是完成后没有调用callback,这是个bug吗?iOS正常。
from cordova-plugin-wechat.
@zhougn 应该是bug。请问:
- 支付完成后,回到你的app了么?
- 你调用其它API(比如分享),callback正常么?
多谢测试。
from cordova-plugin-wechat.
- 支付完成能正常回到app
- Wechat.auth的callback正常
from cordova-plugin-wechat.
可以请问如何获取签名 统一下单的方法吗?
from cordova-plugin-wechat.
@xu-li 我也有和@zhougn同样的问题,支付成功以后点击完成, 微信管比可以正常回到app,但是callback并没有调用。
from cordova-plugin-wechat.
@xu-li 补充下, 进入微信支付页面以后,直接按返回键关闭微信支付界面回到app以后,失败callback也没被调用。
from cordova-plugin-wechat.
@xu-li 看了下微信sdk demo,目录下的请先阅读这里.txt有这么一句:
要保证回调类WXPayEntryActivity.java文件必须位于包名的wxapi目录下,否则会导致无法回调的情况,注意:此条仅仅适用于android,ios有固定格式,请参考ios demo。
是否这是导致回掉不成功的原因?
from cordova-plugin-wechat.
android可以支付(虽然没回调),iOS启动微信以后,界面是空白,中间显示“确定”按钮,只能点确定,点击以后关闭微信回到原界面,取消回调有调用到。
环境:cordova 5.1.1.1, 需要做特殊处理吗?
from cordova-plugin-wechat.
@ryanlin1986 不确定android的问题,我明天看一下。
ios界面空白,基本是你的参数错误,后台代码可以参照这里。
from cordova-plugin-wechat.
from cordova-plugin-wechat.
@xu-li 感谢 已经成功 继续支持插件开发
from cordova-plugin-wechat.
@ryanlin1986 你是对的。微信支付的回调竟然和分享的回调用的不是同一个Activity。
多谢 @zhougn 和 @ryanlin1986 提供测试。
from cordova-plugin-wechat.
@xu-li 经测试android版已经回调已经成功,非常感谢!
from cordova-plugin-wechat.
请问大家有在iOS上成功发起过支付的吗?
android下可以,iOS总是打开微信以后空白背景只有一个确定按钮。
确定用的参数是android iOS完全一样(服务端返回)。
from cordova-plugin-wechat.
不好意思问题已解决,
时间戳我弄成毫秒了,android上正常,实际上应该用秒,android,ios都OK了。
from cordova-plugin-wechat.
https://api.mch.weixin.qq.com/pay/unifiedorder,这个接口我是在客户端请求的,这样会影响正常支付吗?
iOS总是打开微信以后空白背景只有一个确定按钮。因为没有服务端notify_url这个参数填随便填的“http://localhost”,不知道什么原因导致的不能支付请求帮助 @xu-li
from cordova-plugin-wechat.
@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.
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 + '¬ify_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.
@BBPen 你的sign重复用了?sign要生成两次,第一次是调用unified api之前,第二次是对有prepayid的map。你可以看我的demo。
from cordova-plugin-wechat.
问题解决了 @xu-li
from cordova-plugin-wechat.
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.
@BBPen 不知道,你可以google一下,比如这个结果。
from cordova-plugin-wechat.
Related Issues (20)
- 安卓11分享闪退
- Android通过查看日志发现wechat.auth有返回值,但是wechat.auth的success回调没有接收到 HOT 5
- The app is blocked from being shared. Unable to share on WeChat. HOT 1
- 支援AppID動態設定
- Capacitor can't get any response from Wechat.auth() HOT 4
- 安卓10 分享微信,提示"未安装微信" HOT 3
- capacitor 如何配置? HOT 5
- 微信的wxapi.WXEntryActivity及wxapi.WXPayEntryActivity的的建议
- 无法分享微信或者验证,反复跳转 HOT 2
- 安卓分享小程序闪退
- HarmonyOS 未授权存储权限,点击分享到微信。应用闪退 HOT 3
- 部分安卓机型调用分享小程序闪退
- Build fail on M1 Mac
- 安卓11系统以上分享文件异常 HOT 1
- BSF软件基金会(最新可用版本) HOT 2
- Capacitor 支付成功没有回调 HOT 1
- Cordova打包的iOS应用,调用微信支付时,出现“发送请求失败”错误
- 在ios中,使用微信分享好友或微信分享朋友圈,造成内存泄漏,程序卡死退出
- Can Cordova10 be supported? HOT 1
- capacitor 5.0 项目中可以使用该插件吗
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-plugin-wechat.