|
|
@@ -20,6 +20,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
|
|
import org.thymeleaf.util.StringUtils;
|
|
|
|
|
|
import com.gagaframework.web.parameter.GagaMap;
|
|
|
+import com.gagaframework.web.rest.server.GagaResponseStatus;
|
|
|
import com.style24.core.biz.service.TscFreegiftService;
|
|
|
import com.style24.core.biz.service.TscKakaoPayService;
|
|
|
import com.style24.core.biz.service.TscOrderService;
|
|
|
@@ -816,14 +817,19 @@ public class TsfOrderController extends TsfBaseController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/kakao/payment/ready")
|
|
|
@ResponseBody
|
|
|
- public KakaoPay kakaoPaymentReady(@RequestBody Order order) {
|
|
|
+ public GagaMap kakaoPaymentReady(@RequestBody Order order) {
|
|
|
+ GagaMap result = new GagaMap();
|
|
|
+
|
|
|
if (TsfSession.getInfo().getCustNo() == null) {
|
|
|
order.setCustNo(0);
|
|
|
} else {
|
|
|
order.setCustNo(TsfSession.getInfo().getCustNo());
|
|
|
}
|
|
|
|
|
|
- return kakaoPayService.kakaoPaymentReady(order);
|
|
|
+ result.set("kakaoPay", kakaoPayService.kakaoPaymentReady(order));
|
|
|
+ result.set("status", GagaResponseStatus.SUCCESS.getCode());
|
|
|
+
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -856,18 +862,68 @@ public class TsfOrderController extends TsfBaseController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/kakao/payment/approve")
|
|
|
@ResponseBody
|
|
|
- public Payment approveKakaoPayment(@RequestBody Order order) {
|
|
|
+ public GagaMap approveKakaoPayment(@RequestBody Order order) {
|
|
|
+ GagaMap result = new GagaMap();
|
|
|
+
|
|
|
if (TsfSession.getInfo().getCustNo() == null) {
|
|
|
order.setCustNo(0);
|
|
|
} else {
|
|
|
order.setCustNo(TsfSession.getInfo().getCustNo());
|
|
|
}
|
|
|
|
|
|
- Payment payment = kakaoPayService.approveKakaoPayment(order);
|
|
|
-
|
|
|
- KakaoPay kakaoPay = kakaoPayService.getKakaoPaymentOrder(order);
|
|
|
- log.info("kakaoPay >>> {}", kakaoPay);
|
|
|
+ result.set("payment", kakaoPayService.approveKakaoPayment(order));
|
|
|
+ result.set("status", GagaResponseStatus.SUCCESS.getCode());
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 카카오페이 결제 조회
|
|
|
+ *
|
|
|
+ * @param Order
|
|
|
+ * @return GagaMap
|
|
|
+ * @author card007
|
|
|
+ * @since 2021. 03. 04
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/kakao/payment/order")
|
|
|
+ @ResponseBody
|
|
|
+ public GagaMap kakaoPaymentOrder(@RequestBody Order order) {
|
|
|
+ GagaMap result = new GagaMap();
|
|
|
+
|
|
|
+ if (TsfSession.getInfo().getCustNo() == null) {
|
|
|
+ order.setCustNo(0);
|
|
|
+ } else {
|
|
|
+ order.setCustNo(TsfSession.getInfo().getCustNo());
|
|
|
+ }
|
|
|
+
|
|
|
+ result.set("kakaoPay", kakaoPayService.getKakaoPaymentOrder(order));
|
|
|
+ result.set("status", GagaResponseStatus.SUCCESS.getCode());
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 카카오페이 결제 취소
|
|
|
+ *
|
|
|
+ * @param Order
|
|
|
+ * @return GagaMap
|
|
|
+ * @author card007
|
|
|
+ * @since 2021. 03. 04
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/kakao/payment/cancel")
|
|
|
+ @ResponseBody
|
|
|
+ public GagaMap cancelKakaoPayment(@RequestBody Order order) {
|
|
|
+ GagaMap result = new GagaMap();
|
|
|
+
|
|
|
+ if (TsfSession.getInfo().getCustNo() == null) {
|
|
|
+ order.setCustNo(0);
|
|
|
+ } else {
|
|
|
+ order.setCustNo(TsfSession.getInfo().getCustNo());
|
|
|
+ }
|
|
|
+
|
|
|
+ result.set("kakaoPay", kakaoPayService.cancelKakaoPayment(order));
|
|
|
+ result.set("status", GagaResponseStatus.SUCCESS.getCode());
|
|
|
|
|
|
- return payment;
|
|
|
+ return result;
|
|
|
}
|
|
|
}
|