Comments (6)
调用的返回结果 result 是
{ code: '40002',
msg: 'Invalid Arguments',
subCode: 'isv.invalid-signature',
subMsg:
'验签出错,建议检查签名字符串或签名私钥与应用公钥是否匹配,网关生成的验签字符串为:app_id=&biz_content={"out_trade_no":"","total_amount":"0.01","subject":"账号充值0.01元"}&charset=utf-8&method=alipay.trade.create¬ify_url=*************&sign_type=RSA2×tamp=2019-05-21 17:28:55&version=1.0' }
from alipay-sdk-nodejs-all.
@fatetop 找到本地 node_modules 下的 /lib/alipay.ts#L316,把 signData 打印出来,和服务端返回的签名字符串做一下比较就知道是哪里出问题了
from alipay-sdk-nodejs-all.
@tudou527 您好我也遇到这个问题,
这是我的signData:
signData: { method: 'alipay.trade.pay', app_id: '2016101000650042', charset: 'utf-8', version: '1.0', sign_type: 'RSA2', timestamp: '2019-08-13 15:04:52', notify_url: 'http://127.0.0.1:7002/notify', app_auth_token: '', biz_content: '{"out_trade_no":"20150320010101001","scene":"bar_code","subject":"Iphone6 16G","auth_code":"248494578278479567","total_amount":"0.01","operator_id":"1"}', sign: 'UkQFe0TfDA8e/X4e8wgUybvhmke/U9xW08b75J4UfGN4HfA+AXSA3qZV+S8Toc0nmcEeXD6o9LN7NWdigpPFYXOS+ri1TuI+nEXqKJGA3WZWWGXE+HAjYa9tqIbOVIcu0T6klthJ83zETAOMBPfxfaGZ6Nxg9+YC1KL3XbcLtni5SBBlxIZywJdWmjOj0sqjJmHthN5gnWlkA7GyKtbxt/yAcC6MlbWkcjVz9MZJOpUsozBCsJ+d6mTaNI6UCgdxoZtsjvB4ZqkW4K0WEiLgajfIkgA2Mv+riyQuOWY4SeoWBjxPB+D7V6POh+xVtfEMdDADhlgk1w3sVnP0jaOOnw==' }
这是服务端返回的签名
Jg09v1ddF6LwdH2WrL4JXy9xipPMeXe4Pf0uVrTkFEZhsz7QtqtF7kfQgY3DGWNF9NOuqr0qyHB0LnEGVSqXdVUDBWdpCc5HgWiW7b5cuqRavggDGaA8sRbqNkZt8VKKgBgFSgvVaMdtjUuOmsPw06395s1Hhd0NOaZi5sW6S3Y5ASkKKX/BMtHk8UoG3htMo6tjJZf/c3R8YMMYGZC9p1L9eJ34dlge/eo91Ipr+8rdEAAoCurCZKz5cdxhNK6Dd9j/QKvqZYioiV7azoHxWwU4V6rwbbUTo288mXtNHUt/Xza1pKqS/ziUcfc2poibBpwa6pdo6Be2oE4GqrkJNQ==
这两个sign确实不一样
from alipay-sdk-nodejs-all.
能否提供个 demo 到 tudou527#gmail.com
from alipay-sdk-nodejs-all.
问题解决了吗? 我也遇到同样的问题.
from alipay-sdk-nodejs-all.
已经解决了,我传参的时候加了app_auth_token: '',发现加密时会把值为空的字段排除掉,我把它去调就可以了
from alipay-sdk-nodejs-all.
Related Issues (20)
- 引入SDK有报错信息 HOT 4
- Invalid signature HOT 1
- invalid-signature 错误原因: 验签出错 HOT 1
- 授权信息加载失败 HOT 1
- 生成的wap 订单链接,无法拉起沙盒版支付宝
- 生成的wap 订单链接,无法拉起沙盒版支付宝 HOT 2
- 针对 SPI接口, 有没有完整例子可以参考 HOT 1
- npm audit有高危,也许升级一下urllib?
- 重构使用 支付宝 API v3 接口规范 HOT 3
- alipay.system.oauth.token未返回错误但抛出异常 HOT 2
- v4:支持请求内容加密
- v4:签名算法支持 SM2WithSM3
- alipay.open.file.upload上传超出限制 HOT 4
- v4 支持证书加签
- exec 方法支持 AlipayFormStream HOT 7
- 请求内容驼峰会被意外的转换 HOT 11
- 需要批量付款的api和case HOT 6
- 接口内容加密方式如何验证 HOT 10
- 有支持denojs的计划吗/Is there a plan to support denojs? HOT 3
- update URL for gateway HOT 1
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 alipay-sdk-nodejs-all.