We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unifiedorder unifiedorder = new Unifiedorder(); unifiedorder.setAppid(appid); unifiedorder.setMch_id(mch_id); unifiedorder.setNonce_str(UUID.randomUUID().toString().replace("-", "")); //body中数据设置为中文时,无法验证签名通过 unifiedorder.setBody("商品信息"); unifiedorder.setOut_trade_no("123456"); unifiedorder.setTotal_fee("1");//单位分 unifiedorder.setSpbill_create_ip(request.getRemoteAddr());//IP unifiedorder.setNotify_url("http://mydomain.com/test/notify"); unifiedorder.setTrade_type("JSAPI");//JSAPI,NATIVE,APP,WAP
UnifiedorderResult unifiedorderResult = PayMchAPI.payUnifiedorder(unifiedorder,key); String json = PayUtil.generateMchPayJsRequestJson(unifiedorderResult.getPrepay_id(), appid, key);
The text was updated successfully, but these errors were encountered:
没有设置 openid 参数
Sorry, something went wrong.
底下这段是我运行的代码,我看了一下有设置了 openid 参数不过依然出现 "签名错误" 应该如何解决?
Unifiedorder unifiedorder = new Unifiedorder(); unifiedorder.setAppid(appid); unifiedorder.setMch_id(mchid); unifiedorder.setNonce_str(UUID.randomUUID().toString().toString().replace("-", "")); unifiedorder.setOpenid(session.openid); unifiedorder.setBody("this_is_english"); unifiedorder.setOut_trade_no("123456"); unifiedorder.setTotal_fee("1");//单位分 unifiedorder.setSpbill_create_ip(request.getRemoteAddr());//IP unifiedorder.setNotify_url("http://test.mycompany.com/imis/market/notify"); unifiedorder.setTrade_type("JSAPI");//JSAPI,NATIVE,APP,WAP // 统一下单,生成预支付订单 UnifiedorderResult unifiedorderResult = PayMchAPI.payUnifiedorder(unifiedorder,key);
解决了, 我没去商户平台设置API密钥, 设置后正常
No branches or pull requests
Unifiedorder unifiedorder = new Unifiedorder();
unifiedorder.setAppid(appid);
unifiedorder.setMch_id(mch_id);
unifiedorder.setNonce_str(UUID.randomUUID().toString().replace("-", ""));
//body中数据设置为中文时,无法验证签名通过
unifiedorder.setBody("商品信息");
unifiedorder.setOut_trade_no("123456");
unifiedorder.setTotal_fee("1");//单位分
unifiedorder.setSpbill_create_ip(request.getRemoteAddr());//IP
unifiedorder.setNotify_url("http://mydomain.com/test/notify");
unifiedorder.setTrade_type("JSAPI");//JSAPI,NATIVE,APP,WAP
The text was updated successfully, but these errors were encountered: