|
|
@@ -6,8 +6,9 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.core.env.Environment;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
+import org.springframework.ui.Model;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
@@ -15,11 +16,13 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
|
|
+import org.thymeleaf.util.StringUtils;
|
|
|
|
|
|
import com.gagaframework.web.parameter.GagaMap;
|
|
|
import com.style24.core.biz.service.TscFreegiftService;
|
|
|
import com.style24.core.biz.service.TscKakaoPayService;
|
|
|
import com.style24.core.biz.service.TscOrderService;
|
|
|
+import com.style24.core.support.env.TscConstants;
|
|
|
import com.style24.core.support.message.TscMessageByLocale;
|
|
|
import com.style24.front.biz.service.TsfCartService;
|
|
|
import com.style24.front.biz.service.TsfOrderService;
|
|
|
@@ -58,6 +61,9 @@ public class TsfOrderController extends TsfBaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private TscKakaoPayService kakaoPayService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private Environment env;
|
|
|
|
|
|
/**
|
|
|
* 회원, 비회원 주문페이지
|
|
|
@@ -188,7 +194,7 @@ public class TsfOrderController extends TsfBaseController {
|
|
|
|
|
|
// 3.3 배송비쿠폰목록 조회
|
|
|
Collection<Order> delvCpnList = coreOrderService.getDelvCpnList(order);
|
|
|
-
|
|
|
+
|
|
|
Collection<Order> delvFeeCdList = (Collection<Order>) delvOrderMap.get("delvFeeCdList");
|
|
|
|
|
|
// 3.3.1 배소업체기준 ---> 배송비쿠폰
|
|
|
@@ -248,23 +254,6 @@ public class TsfOrderController extends TsfBaseController {
|
|
|
return mav;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 총알배송 가능 지역 체크
|
|
|
- *
|
|
|
- * @param
|
|
|
- * @return
|
|
|
- * @author jsh77b
|
|
|
- * @since 2021. 02. 08
|
|
|
- */
|
|
|
- @ResponseBody
|
|
|
- @RequestMapping(value = "/create/order")
|
|
|
- public ModelAndView createOrder(Order order) {
|
|
|
- ModelAndView mav = new ModelAndView();
|
|
|
-
|
|
|
- mav.setViewName(super.getDeviceViewName("pg/kcpOrder"));
|
|
|
- return mav;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 주문페이지
|
|
|
*
|
|
|
@@ -396,6 +385,56 @@ public class TsfOrderController extends TsfBaseController {
|
|
|
return mav;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 주문 데이터 생성
|
|
|
+ *
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ * @author xodud1202
|
|
|
+ * @since 2021. 03. 04
|
|
|
+ */
|
|
|
+ @PostMapping("/create/order")
|
|
|
+ public ModelAndView createOrder(Order order) {
|
|
|
+ ModelAndView mav = new ModelAndView();
|
|
|
+
|
|
|
+ // KCP CARD 전송 데이터
|
|
|
+ Payment payment = new Payment();
|
|
|
+ // KCP 주문요청 공통 데이터
|
|
|
+ payment.setReqTx("pay"); // 필수 (주문시 only "pay")
|
|
|
+ payment.setOrdrIdxx((int)(Math.random()*10000));// 필수
|
|
|
+ payment.setPayMethod("100000000000"); // 필수 결제수단코드(신용카드 : 100000000000, 계좌이체 : 010000000000, 가상계좌 : 001000000000, 포인트 : 000100000000, 휴대폰 : 000010000000, 상품권 : 000000001000, ARS : 000000000010)
|
|
|
+ payment.setGoodName("LTY_TEST_GOODS_NAME"); // 필수
|
|
|
+ payment.setGoodMny(1779); // 필수
|
|
|
+ payment.setBuyrName("LTY"); // 필수
|
|
|
+ payment.setBuyrMail("xodud1202@naver.com"); // 선택
|
|
|
+ payment.setBuyrTel1(""); // 선택, 일반 전화번호
|
|
|
+ payment.setBuyrTel2("010-7111-4489"); // 필수, 휴대폰번호
|
|
|
+ payment.setCurrency("WON"); // 필수, 원화 : WON, 달러 : USD
|
|
|
+ payment.setShopUserId(1000006); // 필수, 쇼핑몰회원ID (CUST_NO)
|
|
|
+ // KCP 공통 변경되지 않는 값
|
|
|
+ payment.setSiteCd(env.getProperty("pg.kcp.site.cd")); // 상점코드
|
|
|
+ payment.setSiteName(env.getProperty("pg.kcp.site.name")); // 상점 이름 (영문 작성 권장)
|
|
|
+ payment.setModuleType(env.getProperty("pg.kcp.module.type"));
|
|
|
+ payment.setGoodExpr("0"); // 제공 기간 설정 0:일회성 1:기간설정(ex 1:2012010120120131)
|
|
|
+
|
|
|
+ // KCP 신용카드 옵션
|
|
|
+ payment.setQuotaopt(12); // 최대 할부 개월 수
|
|
|
+
|
|
|
+ // KCP PAYCO
|
|
|
+ if(!StringUtils.isEmpty(payment.getPgGb()) && TscConstants.PgGb.PAYCO.value().equals(payment.getPgGb())) { // PAYCO일경우
|
|
|
+ payment.setPaycoDirect("Y");
|
|
|
+ payment.setPayMthod("100000000000"); // PAYCO일때 payMethod 뿐 아니라 payMthod도 송부해야함. cart와 동일하게 송부하면됨.
|
|
|
+ payment.setPayMethod("100000000000"); // CARD로 변경
|
|
|
+ }
|
|
|
+
|
|
|
+ mav.addObject("payment", payment);
|
|
|
+ //model.addAttribute("payment", payment);
|
|
|
+
|
|
|
+ mav.setViewName(super.getDeviceViewName("pg/kcpOrder"));
|
|
|
+ return mav;
|
|
|
+ //return super.getDeviceViewName("pg/kcpOrder");
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 카카오페이 결제준비 처리
|
|
|
*
|