|
@@ -71,6 +71,15 @@ public class OrderPayController {
|
|
|
return "WeixinPayHtml";
|
|
return "WeixinPayHtml";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @RequestMapping(value = "/gift/weixin_pc")
|
|
|
|
|
+ public String payGiftOrderWeixinPC(@RequestParam Long id, @RequestParam String code, Model model) throws WxPayException, EncoderException, WxErrorException {
|
|
|
|
|
+ WxMpOAuth2AccessToken accessToken = wxMpService.oauth2getAccessToken(code);
|
|
|
|
|
+ WxMpUser user = wxMpService.oauth2getUserInfo(accessToken, null);
|
|
|
|
|
+ WxPayMpOrderResult payParams = (WxPayMpOrderResult) assetService.payOrderWeixin(id, WxPayConstants.TradeType.JSAPI, user.getOpenId());
|
|
|
|
|
+ model.addAttribute("payParams", JSON.toJSONString(payParams));
|
|
|
|
|
+ return "PayOrderPC";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public void detectUA(String ua, Model model) {
|
|
public void detectUA(String ua, Model model) {
|
|
|
boolean weixin = Pattern.matches(".*(micromessenger).*", ua.toLowerCase());
|
|
boolean weixin = Pattern.matches(".*(micromessenger).*", ua.toLowerCase());
|
|
|
boolean ios = Pattern.matches(".*(ipad|iphone).*", ua.toLowerCase());
|
|
boolean ios = Pattern.matches(".*(ipad|iphone).*", ua.toLowerCase());
|