|
|
@@ -10,9 +10,13 @@ import org.springframework.core.env.Environment;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.ui.Model;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
import com.style24.core.biz.service.TscOrderService;
|
|
|
+import com.style24.front.biz.service.TsfOrderService;
|
|
|
+import com.style24.front.support.controller.TsfBaseController;
|
|
|
+import com.style24.front.support.security.session.TsfSession;
|
|
|
import com.style24.persistence.domain.Order;
|
|
|
import com.style24.persistence.domain.Payment;
|
|
|
|
|
|
@@ -25,11 +29,14 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
@Controller
|
|
|
@RequestMapping("/pg")
|
|
|
@Slf4j
|
|
|
-public class TsfPgController {
|
|
|
+public class TsfPgController extends TsfBaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private TscOrderService coreOrderService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TsfOrderService orderService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private Environment env;
|
|
|
|
|
|
@@ -120,4 +127,48 @@ public class TsfPgController {
|
|
|
|
|
|
return null;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 결제 PG 요청 완료
|
|
|
+ *
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ * @author xodud1202
|
|
|
+ * @since 2021. 03. 05
|
|
|
+ */
|
|
|
+ @ResponseBody
|
|
|
+ @RequestMapping(value = "/pay/result/response")
|
|
|
+ public ModelAndView payResultResponse(Payment param, HttpServletRequest request, HttpServletResponse response) {
|
|
|
+
|
|
|
+ ModelAndView mav = new ModelAndView();
|
|
|
+
|
|
|
+ Order order = new Order();
|
|
|
+
|
|
|
+ // 1. 로그인체크 후 custNo 설정
|
|
|
+ if (TsfSession.isLogin()) {
|
|
|
+ param.setCustNo(TsfSession.getInfo().getCustNo()); // 고객번호등록
|
|
|
+ order.setCustNo(TsfSession.getInfo().getCustNo());
|
|
|
+ } else {
|
|
|
+ param.setCustNo(0);
|
|
|
+ order.setCustNo(0);
|
|
|
+ }
|
|
|
+
|
|
|
+ param.setUpdNo(param.getCustNo());
|
|
|
+
|
|
|
+ // 2. 결재정보등록(TB_PAYMENT)
|
|
|
+ param = orderService.orderPgPayResult(param, request, response);
|
|
|
+
|
|
|
+ order.setOrdNo(param.getOrdNo());
|
|
|
+ order.setSellGb("10");
|
|
|
+ order.setPgGb(param.getPgGb());
|
|
|
+ order.setPayMeans(param.getPayMeans());
|
|
|
+
|
|
|
+ // TODO 3. 주문정보 업데이트
|
|
|
+ coreOrderService.updateOrderInfo(order);
|
|
|
+
|
|
|
+ mav.addObject("payment", param);
|
|
|
+
|
|
|
+ mav.setViewName(super.getDeviceViewName("pg/kcpOrder"));
|
|
|
+ return mav;
|
|
|
+ }
|
|
|
}
|