mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-02 02:06:38 +08:00
!189 fitler data except H5 data
Merge pull request !189 from Admin/sit-Carl-V3
This commit is contained in:
commit
8c87ce58f0
@ -251,17 +251,18 @@ public class WxpayService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* /H5微信支付(预下单)
|
* /JSAPI微信支付(预下单)
|
||||||
* @return
|
* @return
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public String dounifiedOrderJSAPI(WxPayEntity wxPayEntity) throws Exception {
|
public String dounifiedOrderJSAPI(WxPayEntity wxPayEntity,String resp) throws Exception {
|
||||||
//返回参数
|
//返回参数
|
||||||
Map<String, String> returnMap = new HashMap<>();
|
Map<String, String> returnMap = new HashMap<>();
|
||||||
WXPay wxpay = new WXPay(config);
|
WXPay wxpay = new WXPay(config);
|
||||||
|
// String getopenid_url = "https://api.weixin.qq.com/sns/oauth2/access_token";
|
||||||
|
// String param="appid="+config.getAppID()+"&secret="+config.getKey()+"&code="+code+"&grant_type=authorization_code";
|
||||||
//请求参数封装
|
//请求参数封装
|
||||||
Map<String, String> data = new HashMap<>();
|
Map<String, String> data = new HashMap<>();
|
||||||
|
|
||||||
data.put("out_trade_no",wxPayEntity.getOut_trade_no());
|
data.put("out_trade_no",wxPayEntity.getOut_trade_no());
|
||||||
data.put("notify_url",config.notify_url);
|
data.put("notify_url",config.notify_url);
|
||||||
data.put("fee_type","CNY");
|
data.put("fee_type","CNY");
|
||||||
@ -269,6 +270,7 @@ public class WxpayService {
|
|||||||
data.put("spbill_create_ip", SmartIPUtil.getLocalHostIP());
|
data.put("spbill_create_ip", SmartIPUtil.getLocalHostIP());
|
||||||
data.put("trade_type", "JSAPI"); // 此处指定为H5支付
|
data.put("trade_type", "JSAPI"); // 此处指定为H5支付
|
||||||
data.put("body","皇家宠物食品官方商城");
|
data.put("body","皇家宠物食品官方商城");
|
||||||
|
data.put("openid", resp.indexOf("openid") != -1 ? JSONObject.parseObject(resp).getString("openid") : "");
|
||||||
data.put("nonce_str", WXPayUtil.generateNonceStr());
|
data.put("nonce_str", WXPayUtil.generateNonceStr());
|
||||||
data.put("product_id",wxPayEntity.getProduct_id());
|
data.put("product_id",wxPayEntity.getProduct_id());
|
||||||
String s = WXPayUtil.generateSignature(data, config.getKey()); //签名
|
String s = WXPayUtil.generateSignature(data, config.getKey()); //签名
|
||||||
|
Loading…
Reference in New Issue
Block a user