- 根据官方的支付例子,运行出现问题。开发环境正常,服务器上,运行到构建NativePayService
根据官方的支付例子,运行出现问题。开发环境正常,服务器上,运行到构建NativePayService public static String signleOrder(String subMchid, String outTradeNo,Integer money,Boolean profit_sharing, ContractFeeItem feeItem) { // 使用自动更新平台证书的RSA配置 // 一个商户号只能初始化一个配置,否则会因为重复的下载任务报错 try { Config config = new RSAPublicKeyConfig.Builder() .merchantId(merchantId) .privateKeyFromPath(privateKeyPath) .publicKeyFromPath(publicKeyPath) .publicKeyId(publickeyId) .merchantSerialNumber(merchantSerialNumber) .apiV3Key(apiV3Key) .build(); // 构建service NativePayService service = new NativePayService.Builder().config(config).build(); // request.setXxx(val)设置所需参数,具体参数可见Request定义 PrepayRequest request = new PrepayRequest(); Amount amount = new Amount(); amount.setTotal(money); request.setAmount(amount); request.setSpAppid(PayUtils.appid); request.setSpMchid(merchantId);// request.setSubMchid(subMchid); request.setDescription(feeItem.getFeeName()); request.setNotifyUrl("http://XXXXXXXXXXXXX/wxHt/callBack/singleNativePay/"+feeItem.getId()+"/"+outTradeNo+".html"); request.setOutTradeNo(outTradeNo); SettleInfo settleInfo=new SettleInfo(); settleInfo.setProfitSharing(profit_sharing); //request.setSettleInfo(settleInfo); // 调用下单方法,得到应答\ System.out.println("request=="+request); PrepayResponse response = service.prepay(request); System.out.println("response=="+response); return response.getCodeUrl(); } catch (Exception e) { e.printStackTrace(); } return null; } public static String signleOrder(String subMchid, String outTradeNo,Integer money,Boolean profit_sharing, ContractFeeItem feeItem) { // 使用自动更新平台证书的RSA配置 // 一个商户号只能初始化一个配置,否则会因为重复的下载任务报错 try { Config config = new RSAPublicKeyConfig.Builder() .merchantId(merchantId) .privateKeyFromPath(privateKeyPath) .publicKeyFromPath(publicKeyPath) .publicKeyId(publickeyId) .merchantSerialNumber(merchantSerialNumber) .apiV3Key(apiV3Key) .build(); // 构建service NativePayService service = new NativePayService.Builder().config(config).build(); // request.setXxx(val)设置所需参数,具体参数可见Request定义 PrepayRequest request = new PrepayRequest(); Amount amount = new Amount(); amount.setTotal(money); request.setAmount(amount); request.setSpAppid(PayUtils.appid); request.setSpMchid(merchantId);// request.setSubMchid(subMchid); request.setDescription(feeItem.getFeeName()); request.setNotifyUrl("http://XXXXXXXXXXXXX/wxHt/callBack/singleNativePay/"+feeItem.getId()+"/"+outTradeNo+".html"); request.setOutTradeNo(outTradeNo); SettleInfo settleInfo=new SettleInfo(); settleInfo.setProfitSharing(profit_sharing); //request.setSettleInfo(settleInfo); // 调用下单方法,得到应答\ System.out.println("request=="+request); PrepayResponse response = service.prepay(request); System.out.println("response=="+response); return response.getCodeUrl(); } catch (Exception e) { e.printStackTrace(); } return null; }
10-25 - 证书更换?
[图片] https://developers.weixin.qq.com/community/develop/article/doc/0002284c6948c066ad919a2bc67813 这个需要从新申请api证书吗
06-25 - 卡券开发切换为第三方代制模式 点击无效?
卡券开发切换为第三方代制模式 点击无效,发现有js报错。卡卷概况如图显示,哪位知道是怎么回事吗。[图片]
2023-11-24 - 创建门店接口报61016 是怎么回事?
{"errcode":61016,"errmsg":"function category of API need be confirmed by component rid: 63575aa4-545f6110-4850d304"} 公众号是服务号 且已经认证,是托管第三方的,哪位高人能帮看下怎么回事吗
2022-10-25