main
parent
a12486f27c
commit
b50e0222ac
|
|
@ -19,11 +19,10 @@ public class PayConfig {
|
|||
//异步回调地址
|
||||
public String wechat_notify_url = "127.0.0.1";
|
||||
//商品描述
|
||||
public String body = "二手车";
|
||||
public String body = "会员充值";
|
||||
|
||||
public String APP_KEY = "Zzvi53pvCLUdFtvQ3EB0QLHQeKTctZ1c";
|
||||
|
||||
public String payUrl = "https://api.mch.weixin.qq.com/pay/unifiedorder";//下单
|
||||
public static String PAY_API_UNIFIEDORDER = "https://api.mch.weixin.qq.com/pay/unifiedorder";//下单
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,14 +25,13 @@ public class PayServiceImpl implements IPayService {
|
|||
@Override
|
||||
public String getPrepayId(String orderId, int orderMoney, String nonce_str, long timeStamp, PayConfig weChatConfig) {
|
||||
//long fee = (long) (orderMoney * 100); // 转换为分
|
||||
long fee = (long) (orderMoney);
|
||||
SortedMap<String, Object> parameterMap = new TreeMap<String, Object>();
|
||||
parameterMap.put("appid", weChatConfig.getAPPID());
|
||||
parameterMap.put("mch_id", weChatConfig.getMCH_ID());
|
||||
parameterMap.put("nonce_str", nonce_str);
|
||||
parameterMap.put("body", weChatConfig.getBody());
|
||||
parameterMap.put("out_trade_no", orderId);
|
||||
parameterMap.put("total_fee", fee);
|
||||
parameterMap.put("total_fee", orderMoney);
|
||||
parameterMap.put("spbill_create_ip","127.0.0.1");
|
||||
parameterMap.put("notify_url", weChatConfig.getWechat_notify_url());
|
||||
parameterMap.put("trade_type", "APP");
|
||||
|
|
|
|||
Loading…
Reference in New Issue