Project

General

Profile

New Function #188

Updated by Deca Park 10 months ago

<p>1.문제점 (Issue)</p> 

 <p style="margin-left: 40px;">1) 앱에서 이미 처리된 주문결제를 다시 PG 결제 컨펌 호출 (백버튼 클릭)<br /> 
 &nbsp; - [API] POST /api/pay_confirm (PG 결제 컨펌)<br /> 
 &nbsp; - 이 경우 다음과 같은 에러 발생<br /> 
 &nbsp; &nbsp; [PG confirm API] fail - paymentKey: gpMwnkjKyO6BYq7GWPVv4wK7RN4xNX8NE5vbo1d4JlALRXxz, orderId: 231127142350XBUB, error code: ALREADY_PROCESSED_PAYMENT, error message: 이미 처리된 결제 입니다.<br /> 
 &nbsp; - 현재 API 로직에서 PG 결제 컨펌 에러 발생시 주문결제 데이터 삭제 처리</p> 

 <p>2.To-do</p> 

 <p>&nbsp; 1) <strong>[API] POST /api/pay_confirm (PG 결제 컨펌)</strong></p> 

 <p>&nbsp; &nbsp; &nbsp;a) <strong>OrderController.payConfirm()</strong></p> 

 <p>&nbsp; &nbsp; &nbsp; &nbsp;a-1) As-is<br /> 
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - if&nbsp;pgPaymentService.processPayConfirm fails (return error), delete order data</p> 

 <p>&nbsp; &nbsp; &nbsp; &nbsp;<strong>a-2) To-be<br /> 
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[Logic]<br /> 
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;when&nbsp;</strong>processPayConfirm fails<br /> 
 <strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - if pgErrorCode = &#39;ALREADY_PROCESSED_PAYMENT&#39;, SKIP&nbsp;delete order</strong><br /> 
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;- else<br /> 
 <strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + if&nbsp;st_order_payment.payment_status = &#39;PS01&#39; (결제대기), delete order as current<br /> 
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + &nbsp;- else. SKIP delete order</strong></p> 

Back