개인결제 내역이 존재하지 않습니다.

'); $od_tno = $od['pp_tno']; $goods_name = $od['pp_name'].'님 개인결제'; $settle_case = $od['pp_settle_case']; $order_price = $od['pp_receipt_price']; $od_casseqno = $od['pp_casseqno']; $od_name = $od['pp_name']; $od_email = $od['pp_email']; $od_tel = $od['pp_hp']; } else { $od = sql_fetch(" select * from {$g5['g5_shop_order_table']} where od_id = '$od_id' "); if (!$od) die('

주문서가 존재하지 않습니다.

'); $od_tno = $od['od_tno']; $goods = get_goods($od['od_id']); $goods_name = $goods['full_name']; $settle_case = $od['od_settle_case']; $order_price = $od['od_tax_mny'] + $od['od_vat_mny'] + $od['od_free_mny']; $od_casseqno = $od['od_casseqno']; $od_name = $od['od_name']; $od_email = $od['od_email']; $od_tel = $od['od_tel']; } switch($settle_case) { case '가상계좌': case '계좌이체': case '무통장': // 토스페이먼츠는 결제수단 구분 없이 현금영수증 발급 가능 break; default: die('

현금영수증은 무통장, 가상계좌, 계좌이체에 한해 발급요청이 가능합니다.

'); break; } // 토스페이먼츠 현금영수증 발급 요청 $orderId = $od_id; $amount = $order_price; $type = ($_POST['tr_code'] == '0') ? '소득공제' : '지출증빙'; $customerIdentityNumber = $_POST['id_info']; $orderName = $od_name; $customerEmail = $_POST['buyeremail'] ?: $od_email; $customerMobilePhone = $_POST['buyertel'] ?: $od_tel; // 토스페이먼츠 현금영수증 발급 API 호출 $toss->setCashReceiptsData([ 'orderId' => $orderId, 'amount' => $amount, 'type' => $type, 'customerIdentityNumber' => $customerIdentityNumber, 'orderName' => $goods_name, ]); $toss_result = $toss->issueCashReceipt(); /* * 토스페이먼츠 현금영수증 발급 요청 결과처리 */ if ($toss_result && isset($toss->responseData['receiptKey'])) { // 현금영수증 발급 성공 $data = $toss->responseData; $receiptKey = $data['receiptKey']; // 현금영수증 발급 키 $cash_no = $data['issueNumber']; // 현금영수증 발급 번호 $approvedAt = $data['requestedAt']; $cash = array(); $cash['receiptKey'] = $receiptKey; $cash['approvedAt'] = $approvedAt; $cash['orderId'] = $data['orderId']; $cash['amount'] = $data['amount']; $cash['type'] = $data['type']; $cash['receiptUrl'] = $data['receiptUrl']; $cash_info = serialize($cash); if($tx == 'personalpay') { $sql = " update {$g5['g5_shop_personalpay_table']} set pp_cash = '1', pp_cash_no = '$cash_no', pp_cash_info = '$cash_info' where pp_id = '$orderId' "; } else { $sql = " update {$g5['g5_shop_order_table']} set od_cash = '1', od_cash_no = '$cash_no', od_cash_info = '$cash_info' where od_id = '$orderId' "; } $result = sql_query($sql, false); if(!$result) { // DB 정보갱신 실패시 취소 $cancel_result = $toss->cancelCashReceipt($receiptKey, 'DB 업데이트 실패로 인한 취소'); if (!$cancel_result) { $msg = '현금영수증 취소 요청처리가 정상적으로 완료되지 않았습니다.\\n'. $toss->responseData['message']; alert_close($msg); } } } else { // API 요청 실패 화면처리 $msg = '현금영수증 발급 요청처리가 정상적으로 완료되지 않았습니다.\\n'. $toss->responseData['message']; alert($msg); } $g5['title'] = ''; include_once(G5_PATH.'/head.sub.php'); ?>

현금영수증 - 토스페이먼츠

responseData['receiptKey'])): ?>
결과 발급 완료
현금영수증 발급번호 responseData['issueNumber']; ?>
주문번호 responseData['orderId']; ?>
발급 유형 responseData['type']; ?>
금액 responseData['amount']); ?>원
승인시간 responseData['requestedAt'])); ?>
현금영수증 확인

영수증 확인은 실 등록의 경우에만 가능합니다.

결과 발급 실패
오류 메시지