支付宝退费接口参数无效怎么回事?
String appid = AlipayServiceEnvConstants.APP_ID;
String privateKey = AlipayServiceEnvConstants.PRIVATE_KEY;
String publicKey = AlipayServiceEnvConstants.ALIPAY_PUBLIC_KEY;
AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do",appid,privateKey,"json","UTF-8",publicKey,"RSA2");
// AlipayClient alipayClient = AlipayAPIClientFactory.getAlipayClientRSA2();
AlipayTradeRefundRequest request = new AlipayTradeRefundRequest();
String bizContent = "{" +
"\"out_trade_no\":"+outTradeNo+"," +
"\"trade_no\":"+tradeNo+"," +
"\"refund_amount\":"+money+"," +
"\"refund_reason\":\"正常退款\"," +
"\"out_request_no\":\"\"," +
"\"operator_id\":\"\"," +
"\"store_id\":\"\"," +
"\"terminal_id\":\"\"}";
request.setBizContent(bizContent);
logger.info(bizContent);
AlipayTradeRefundResponse response = null;
try {
response = alipayClient.execute(request);
}
总是报{"alipay_trade_refund_response":{"code":"40004","msg":"Business Failed","sub_code":"ACQ.INVALID_PARAMETER","sub_msg":"参数无效"},"sign":"M7bgiWLh6zdWKMZtsE/Y3rZUwoDu8DIyZtDOXEupGFQNOyIjhxpWMs6Kzh0rIcPVvII/3e1x5AhhJVMdMYwrZ+qpeaUTUxpvC4zxD3KOW0xlN1IWz+cJY7f5hmzdIFjmDOs5gAqE+3piEjVNnNAybDBquiGwXXoz0caRttH+l1WogNE6FjRK2wcvxB6G4fu9flopj6dv6L1Ss2corefXUyQtqvM8rPbQQHWvijFQClLZHEwf6W4plFf7ig5q5Rd6aibuoaLCPTi1GF925MTo/V5T6QEp4yAFrLSl5JO3Nzh9kgqQcU+4YBLliMXoRAC+hx+2GXrl17WZ2ePM26oqDA=="}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
钱都已经付了,哪儿有退的道理。
检查一下请求参数,肯定哪个请求字段赋值不正确。
蚂蚁金服的文档中,看能不能帮上你。https://doc.open.alipay.com/d...