|
|
@ -5,10 +5,17 @@ import au.com.royalpay.payment.tools.CommonConsts;
|
|
|
|
import au.com.royalpay.payment.tools.connections.mpsupport.beans.WxOauthType;
|
|
|
|
import au.com.royalpay.payment.tools.connections.mpsupport.beans.WxOauthType;
|
|
|
|
import au.com.royalpay.payment.tools.permission.alipay.AlipayMapping;
|
|
|
|
import au.com.royalpay.payment.tools.permission.alipay.AlipayMapping;
|
|
|
|
import au.com.royalpay.payment.tools.permission.wechat.WechatMapping;
|
|
|
|
import au.com.royalpay.payment.tools.permission.wechat.WechatMapping;
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestHeader;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
@ -19,6 +26,7 @@ import javax.annotation.Resource;
|
|
|
|
@Controller
|
|
|
|
@Controller
|
|
|
|
@RequestMapping("/act/encourage_money")
|
|
|
|
@RequestMapping("/act/encourage_money")
|
|
|
|
public class EncourageMoneyController {
|
|
|
|
public class EncourageMoneyController {
|
|
|
|
|
|
|
|
Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private EncourageService encourageService;
|
|
|
|
private EncourageService encourageService;
|
|
|
|
|
|
|
|
|
|
|
@ -38,17 +46,22 @@ public class EncourageMoneyController {
|
|
|
|
|
|
|
|
|
|
|
|
@WechatMapping(value = "/orders/{orderId}/wechat", method = RequestMethod.GET)
|
|
|
|
@WechatMapping(value = "/orders/{orderId}/wechat", method = RequestMethod.GET)
|
|
|
|
public JSONObject takeEncourageMoneyWeChat(@PathVariable String orderId, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wxUser) {
|
|
|
|
public JSONObject takeEncourageMoneyWeChat(@PathVariable String orderId, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wxUser) {
|
|
|
|
|
|
|
|
logger.info("kiratest---wechat");
|
|
|
|
if (wxUser == null) {
|
|
|
|
if (wxUser == null) {
|
|
|
|
return new JSONObject();
|
|
|
|
return new JSONObject();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
logger.info(wxUser.toJSONString());
|
|
|
|
return encourageService.takeEncourageMoney(orderId, wxUser.getString("openid"));
|
|
|
|
return encourageService.takeEncourageMoney(orderId, wxUser.getString("openid"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@AlipayMapping(value = "/orders/{orderId}/alipay", method = RequestMethod.GET)
|
|
|
|
@AlipayMapping(value = "/orders/{orderId}/alipay", method = RequestMethod.GET)
|
|
|
|
public JSONObject takeEncourageMoneyAlipay(@PathVariable String orderId, @ModelAttribute(CommonConsts.ALIUSER) JSONObject alipayInfo) {
|
|
|
|
public JSONObject takeEncourageMoneyAlipay(@PathVariable String orderId, @ModelAttribute(CommonConsts.ALIUSER) JSONObject alipayInfo) {
|
|
|
|
|
|
|
|
logger.info("kiratest---alipay");
|
|
|
|
|
|
|
|
|
|
|
|
if (alipayInfo == null) {
|
|
|
|
if (alipayInfo == null) {
|
|
|
|
return new JSONObject();
|
|
|
|
return new JSONObject();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
logger.info(alipayInfo.toJSONString());
|
|
|
|
return encourageService.takeEncourageMoney(orderId, alipayInfo.getString("user_id"));
|
|
|
|
return encourageService.takeEncourageMoney(orderId, alipayInfo.getString("user_id"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|