| | |
| | | public class WxPayUtils { |
| | | |
| | | public static String getUnifiedorder(String appid, String mchId, String payKey, String notifyUrl, String body, |
| | | String openid, String outTradeNo, BigDecimal money) { |
| | | String openid, String outTradeNo, BigDecimal money,String attach) { |
| | | String nonceStr = PayUtil.makeUUID(32); |
| | | SortedMap<Object, Object> params = new TreeMap<>(); |
| | | params.put("appid", appid); |
| | |
| | | params.put("nonce_str", nonceStr); |
| | | params.put("notify_url", notifyUrl); |
| | | params.put("openid", openid); |
| | | //附加数据 |
| | | if(StringUtils.isNotEmpty(attach)){ |
| | | params.put("attach", attach); |
| | | } |
| | | params.put("out_trade_no", outTradeNo);// 商品订单号 |
| | | params.put("spbill_create_ip", PayUtil.getLocalIp());// 服务部署的ip |
| | | params.put("total_fee", PayUtil.moneyToIntegerStr(money));// 费用的参数转型 |