小程序在开发调试【周期扣款】的时候,提示【无效签名】,小程序的其他接口如支付,预授权等接口都没出现这个问题,小程序接口:
signStr: data.data.signStr,
success: function (res) {
console.log(res);
},
fail: function (res) {
app.fail("购买失败");
}
});```
signStr值`charset=UTF-8&biz_content=%7B%22period_rule_params%22%3A%7B%22period%22%3A%2230%22%2C%22execute_time%22%3A%222021-06-02%22%2C%22single_amount%22%3A%229.90%22%2C%22period_type%22%3A%22DAY%22%7D%2C%22access_params%22%3A%7B%22channel%22%3A%22ALIPAYAPP%22%7D%2C%22personal_product_code%22%3A%22CYCLE_PAY_AUTH_P%22%2C%22external_agreement_no%22%3A%22SG21559998274785071104%22%2C%22product_code%22%3A%22CYCLE_PAY_AUTH%22%2C%22sign_scene%22%3A%22INDUSTRY%7CLEASE%22%7D&method=alipay.user.agreement.page.sign&format=JSON&sign=aUTglOtYxeWGH%2BDhlHfe0RrSKvTZ1wqKIVq3WZ0YvPUVWXymh0DgacHY77%2BZEKvEK8yO2MdYCQrcx67hd5mnPnQEG58BkgEFOudi8A4f9QlCF0voWgvcDdGldtEbRg00iALHlTh1MGRUwEelyUB3p5g9sh44m4FXz5j2tAcFwzJdjPSd6ZY1sMWZG%2By8S95QKVUy%2Beg42ZZFH1crrUtydX%2BQfkMLnodcfXPUMVEo6X0Q6aWG4tW%2Fbmsmusho9iIJxVUuB6Xbp1pTs2q4F6iwGTpMTyIhh0si9SagD92Q2i6w77M7bKlNZPEiqs%2FBZvD7CRLFCFRqLP2%2BCRYhMrAnZw%3D%3D¬ify_url=http%3A%2F%2Fapi.open.*.com%2Fnotify%2Falipay%2Fdetain&app_id=2018092761510694&sign_type=RSA2&version=1.0×tamp=2021-06-02+17%3A20%3A03`
signStr进行URLDecode后的数据:`charset=UTF-8&biz_content={"period_rule_params":{"period":"30","execute_time":"2021-06-02","single_amount":"9.90","period_type":"DAY"},"access_params":{"channel":"ALIPAYAPP"},"personal_product_code":"CYCLE_PAY_AUTH_P","external_agreement_no":"SG21559998274785071104","product_code":"CYCLE_PAY_AUTH","sign_scene":"INDUSTRY|LEASE"}&method=alipay.user.agreement.page.sign&format=JSON&sign=aUTglOtYxeWGH+DhlHfe0RrSKvTZ1wqKIVq3WZ0YvPUVWXymh0DgacHY77+ZEKvEK8yO2MdYCQrcx67hd5mnPnQEG58BkgEFOudi8A4f9QlCF0voWgvcDdGldtEbRg00iALHlTh1MGRUwEelyUB3p5g9sh44m4FXz5j2tAcFwzJdjPSd6ZY1sMWZG+y8S95QKVUy+eg42ZZFH1crrUtydX+QfkMLnodcfXPUMVEo6X0Q6aWG4tW/bmsmusho9iIJxVUuB6Xbp1pTs2q4F6iwGTpMTyIhh0si9SagD92Q2i6w77M7bKlNZPEiqs/BZvD7CRLFCFRqLP2+CRYhMrAnZw==¬ify_url=http://api.open.*.com/notify/alipay/detain&app_id=2018092761510694&sign_type=RSA2&version=1.0×tamp=2021-06-02 17:20:03`
![image.png](https://ucc.alicdn.com/pic/developer-ecology/bd1df4a7f05b477ba3a549056383e757.png)
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。