| | |
| | | return parameters; |
| | | } |
| | | public static String h5pay(String appid, String mchId, String payKey, String notifyUrl, String body, |
| | | String openid, String outTradeNo, BigDecimal money, String tradeType) { |
| | | String openid, String outTradeNo, BigDecimal money, String tradeType, String clientIp) { |
| | | String nonceStr = PayUtil.makeUUID(32); |
| | | SortedMap<Object, Object> params = new TreeMap<>(); |
| | | params.put("appid", appid); |
| | |
| | | params.put("notify_url", notifyUrl); |
| | | params.put("openid", openid); |
| | | params.put("out_trade_no", outTradeNo);// 商品订单号 |
| | | params.put("spbill_create_ip", PayUtil.getLocalIp());// 服务部署的ip |
| | | params.put("spbill_create_ip", clientIp);// 用户真实ip |
| | | params.put("total_fee", PayUtil.moneyToIntegerStr(money));// 费用的参数转型 |
| | | params.put("trade_type", tradeType);// 对接类型 |
| | | params.put("sign", PayUtil.createSign(PayCpmstant.DEFAULT_ENCODING, params, payKey));// MD5签名 |