mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-04 19:26:41 +08:00
debugger
This commit is contained in:
parent
59c3378371
commit
3deeab7bc2
@ -132,7 +132,7 @@ public class OrderController {
|
|||||||
returnMap.put("orderNumber", ordersEntity.getOrderNo());
|
returnMap.put("orderNumber", ordersEntity.getOrderNo());
|
||||||
returnMap.put("orderAmount", ordersEntity.getOrderAmount());
|
returnMap.put("orderAmount", ordersEntity.getOrderAmount());
|
||||||
// return ResponseDTO.succData(returnMap,wxpayService.generateQRCode(wxPayEntity));
|
// return ResponseDTO.succData(returnMap,wxpayService.generateQRCode(wxPayEntity));
|
||||||
return ResponseDTO.succData(returnMap, wxpayService.testGenerateQRCode(wxPayEntity));
|
return ResponseDTO.succData(returnMap, wxpayService.generateQRCode(wxPayEntity));
|
||||||
}
|
}
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
System.out.println(e.getMessage());
|
System.out.println(e.getMessage());
|
||||||
|
@ -48,29 +48,6 @@ public class WxpayService {
|
|||||||
|
|
||||||
String url = "https://miniapp-test.royalcanin.com.cn/rcmini/h5/";
|
String url = "https://miniapp-test.royalcanin.com.cn/rcmini/h5/";
|
||||||
// String url = "https://miniapp-product.royalcanin.com.cn/rcmini2020";
|
// String url = "https://miniapp-product.royalcanin.com.cn/rcmini2020";
|
||||||
private String urlNative = "https://api.mch.weixin.qq.com/v3/pay/transactions/native";
|
|
||||||
|
|
||||||
public String testGenerateQRCode(WxPayEntity wxPayEntity)throws Exception{
|
|
||||||
String Authorization = "WECHATPAY2-SHA256-RSA2048";
|
|
||||||
long timestamp = System.currentTimeMillis();
|
|
||||||
SortedMap<String,String> data = new TreeMap<>();
|
|
||||||
SortedMap<String, Integer> amount = new TreeMap<>();
|
|
||||||
amount.put("total",Integer.parseInt(getMoney(wxPayEntity.getTotal_fee())));
|
|
||||||
data.put("out_trade_no",wxPayEntity.getOut_trade_no());
|
|
||||||
data.put("notify_url",config.notify_url);
|
|
||||||
data.put("description","皇家宠物食品官方商城");
|
|
||||||
data.put("appid",config.getAppID());
|
|
||||||
data.put("mchid",config.getMchID());
|
|
||||||
net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(data);
|
|
||||||
jsonObject.put("amount",amount);
|
|
||||||
SortedMap<String ,String>hearder = new TreeMap<>();
|
|
||||||
hearder.put("Accept","application/json");
|
|
||||||
hearder.put("Authorization",Authorization +" mchid="+config.getMchID() +",nonce_str=" + WXPayUtil.generateNonceStr() + ",timestamp=" + timestamp + ",signature=" + WXPayUtil.generateSignature(data, config.getKey()) + ",serial_no=" + config.getKey());
|
|
||||||
String sb = SmartHttpUtil.httpPostRaw(urlNative,jsonObject.toString(),hearder,"utf-8");
|
|
||||||
return sb;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String generateQRCode(WxPayEntity wxPayEntity) throws Exception {
|
public String generateQRCode(WxPayEntity wxPayEntity) throws Exception {
|
||||||
WXPay wxpay = new WXPay(config);
|
WXPay wxpay = new WXPay(config);
|
||||||
|
Loading…
Reference in New Issue
Block a user