2.7. 취소 거래내역 조회
2.7.1. 개요
취소 거래 조회를 지원합니다. 3일 이내의 거래만 조회가 가능합니다.
2.7.2. 사용 함수
Map<String, String> data = new HashMap<>();
data.put("merchant_id", merchant_id); // 가맹점 ID
data.put("cancel_merchant_tid", cancel_merchant_tid); // 취소 가맹점 거래 ID
Map<String, String> result = chinaPay.cancelQuery(data);
System.out.println(String.format("result_code : %s", result.get("result_code"))); // 응답 코드
System.out.println(String.format("result_msg : %s", result.get("result_msg"))); // 응답 메시지
System.out.println(String.format("merchant_id: %s", result.get("merchant_id"))); // 가맹점 ID
System.out.println(String.format("org_merchant_tid: %s", result.get("org_merchant_tid"))); // 원거래 가맹점 거래 ID
System.out.println(String.format("cancel_merchant_tid: %s", result.get("cancel_merchant_tid"))); // 취소 가맹점 거래 ID
System.out.println(String.format("fk_tid: %s", result.get("fk_tid"))); // FK 거래 ID
System.out.println(String.format("pay_stat: %s", result.get("pay_stat"))); // 거래 상태
System.out.println(String.format("pay_method: %s", result.get("pay_method"))); // 결제 수단
System.out.println(String.format("cancel_date: %s", result.get("cancel_date"))); // 취소 일자
System.out.println(String.format("cancel_amt: %s", result.get("cancel_amt"))); // 취소 금액
2.7.3. 요청 규격
No |
변수명 |
필수 |
자료형 |
길이 |
비고 |
1 |
merchant_id |
O |
String |
15 |
가맹점 ID |
2 |
cancel_merchant_tid |
O |
String |
30 |
취소 가맹점 거래 ID |
2.7.4. 응답 규격
No |
변수명 |
필수 |
자료형 |
길이 |
비고 |
1 |
result_code |
O |
String |
16 |
응답 코드 |
2 |
result_msg |
O |
String |
128 |
응답 메시지 |
3 |
merchant_id |
O |
String |
15 |
가맹점 ID |
4 |
org_merchant_tid |
O |
String |
30 |
원거래 가맹점 거래 ID |
5 |
cancel_merchant_tid |
O |
String |
30 |
취소 가맹점 거래 ID |
6 |
fk_tid |
X |
String |
30 |
FK 거래 ID |
7 |
pay_stat |
O |
String |
50 |
결제 상태 [상태보기] |
8 |
pay_method |
O |
String |
20 |
결제 수단 |
9 |
cancel_date |
O |
String |
8 |
결제 일자 |
10 |
cancel_amt |
X |
Number |
16 |
취소 금액 |
2.7.5. 결제 상태 (pay_stat)
No |
pay_stat |
설명 |
1 |
SUCCESS |
성공 (MpmCallBack 시 결제성공) |
2 |
REFUND |
취소 완료 |
3 |
REVOKED |
취소 완료 |
4 |
PAYERROR |
결제 실패 |
5 |
USERPAYING |
결제 진행 중 |
6 |
NOTPAY |
결제 진행 중(사용자 비밀번호 요청 전) |