UserPayController.java 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package com.xc.controller.protol;
  2. import com.xc.common.ServerResponse;
  3. import com.xc.service.IPayService;
  4. import javax.servlet.http.HttpServletRequest;
  5. import org.slf4j.Logger;
  6. import org.slf4j.LoggerFactory;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.stereotype.Controller;
  9. import org.springframework.web.bind.annotation.RequestMapping;
  10. import org.springframework.web.bind.annotation.RequestParam;
  11. import org.springframework.web.bind.annotation.ResponseBody;
  12. @Controller
  13. @RequestMapping({"/user/pay/"})
  14. public class UserPayController {
  15. private static final Logger log = LoggerFactory.getLogger(UserPayController.class);
  16. @Autowired
  17. IPayService iPayService;
  18. @RequestMapping({"juhe1.do"})
  19. @ResponseBody
  20. public ServerResponse juhe1(@RequestParam("payType") String payType, @RequestParam("payAmt") String payAmt, HttpServletRequest request) throws Exception {
  21. log.info("发起线上支付 payType = {} payAmt = {}", payType, payAmt);
  22. return this.iPayService.juhenewpay(payType, payAmt, request);
  23. }
  24. @RequestMapping({"juhenewpayNotify.do"})
  25. public String juhenewpayNotify(HttpServletRequest request) throws Exception {
  26. iPayService.juhe1Notify(request);
  27. return "success";
  28. }
  29. @RequestMapping({"flyPay.do"})
  30. @ResponseBody
  31. public ServerResponse flyPay(@RequestParam("payType") String payType, @RequestParam("payAmt") String payAmt, @RequestParam("currency") String currency, HttpServletRequest request) {
  32. log.info("发起 fly 线上支付 payType = {} payAmt = {} currency = {}", new Object[]{payType, payAmt, currency});
  33. return this.iPayService.flyPay(payType, payAmt, currency, request);
  34. }
  35. }