|
@@ -2,11 +2,15 @@ package com.oqpo.api.service.loanmng;
|
2
|
2
|
|
3
|
3
|
|
4
|
4
|
import com.kicc.EasyPayClient;
|
|
5
|
+import com.oqpo.api.entity.oper.UserMngEntity;
|
5
|
6
|
import com.oqpo.api.exception.GlobalException;
|
6
|
7
|
import com.oqpo.api.mapper.loanmng.UnpaidMngMapper;
|
|
8
|
+import com.oqpo.api.mapper.oper.UserMngMapper;
|
7
|
9
|
import com.oqpo.api.service.CommonService;
|
8
|
10
|
import com.oqpo.api.util.StringUtil;
|
|
11
|
+import com.oqpo.api.web.dto.request.loanmng.EasypayPaymentCreateRequest;
|
9
|
12
|
import com.oqpo.api.web.dto.request.loanmng.EasypayPaymentRequest;
|
|
13
|
+import com.oqpo.api.web.dto.response.loanmng.EasypayPaymentCreateResponse;
|
10
|
14
|
import com.oqpo.api.web.dto.response.loanmng.EasypayPaymentResponse;
|
11
|
15
|
import lombok.extern.slf4j.Slf4j;
|
12
|
16
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -23,12 +27,43 @@ public class EasypayPaymentService extends CommonService {
|
23
|
27
|
@Autowired
|
24
|
28
|
private UnpaidMngMapper unpaidMngMapper;
|
25
|
29
|
|
|
30
|
+ private UserMngMapper userMngMapper;
|
|
31
|
+
|
26
|
32
|
@Value("${kicc.gateway}")
|
27
|
33
|
private String kiccGatewayUrl;
|
28
|
34
|
@Value("${kicc.cert_dir}")
|
29
|
35
|
private String kiccCertFile;
|
30
|
36
|
@Value("${kicc.log_dir}")
|
31
|
37
|
private String kiccLogDir;
|
|
38
|
+ @Value("${kicc.javascript_url}")
|
|
39
|
+ private String kiccJavaScriptUrl;
|
|
40
|
+ @Value("${kicc.action.web_url}")
|
|
41
|
+ private String kiccActionWebUrl;
|
|
42
|
+ @Value("${kicc.action.mobile_url}")
|
|
43
|
+ private String kiccActionMobileUrl;
|
|
44
|
+
|
|
45
|
+ /* 결제 생성 */
|
|
46
|
+ @Transactional
|
|
47
|
+ public EasypayPaymentCreateResponse createPayment(String userId, EasypayPaymentCreateRequest easypayPaymentCreateRequest) throws Exception {
|
|
48
|
+ EasypayPaymentCreateResponse response = new EasypayPaymentCreateResponse();
|
|
49
|
+
|
|
50
|
+ // 1. 주문번호 생성
|
|
51
|
+ response.setPoOrdNo(fnGetDealNo(36, ""));
|
|
52
|
+
|
|
53
|
+ // TODO 2. 이지페이 결제요청 데이터 생성
|
|
54
|
+
|
|
55
|
+ // 3. 사용자정보 조회 및 매핑
|
|
56
|
+ UserMngEntity userInfo = userMngMapper.selectUserInfo(userId);
|
|
57
|
+ response.setOrdNm(userInfo.getUserNm()); // 구매자명
|
|
58
|
+ response.setOrdTel(StringUtil.isEmpty(userInfo.getTelNo()) && userInfo.getTelNo().startsWith("010") ? userInfo.getTelNo() : null); // 휴대전화번호
|
|
59
|
+ response.setOrdEmail(userInfo.getEmail()); // 이메일
|
|
60
|
+
|
|
61
|
+ // 4. 이지페이 결제 URL 매핑
|
|
62
|
+ response.setKicc_javascript_url(kiccJavaScriptUrl);
|
|
63
|
+ response.setKicc_action_web_url(kiccActionWebUrl);
|
|
64
|
+ response.setKicc_action_mobile_url(kiccActionMobileUrl);
|
|
65
|
+ return response;
|
|
66
|
+ }
|
32
|
67
|
|
33
|
68
|
/* 결제 요청 */
|
34
|
69
|
@Transactional
|