@extends('web.layouts.subpage') @php $mypageActive = $mypageActive ?? 'usage'; $attempt = $attempt ?? []; $order = $order ?? []; $items = $items ?? []; $pins = $pins ?? []; $pinsOpened = (bool)($pinsOpened ?? false); // 기존 핀 오픈 상태 $pinsRevealed = (bool)($pinsRevealed ?? false); // 이번 요청에서 실핀 표시 여부 $pinsRevealLocked = (bool)($pinsRevealLocked ?? false); // 실핀 확인 이력(취소 잠금) $canCancel = (bool)($canCancel ?? false); $backToListQuery = request()->only(['q', 'method', 'status', 'from', 'to', 'page']); $backToListQuery = array_filter($backToListQuery, fn($v) => $v !== null && $v !== ''); $methodLabel = function ($m) { $m = (string)$m; return match ($m) { 'card' => '카드', 'phone' => '휴대폰', 'wire' => '계좌이체', 'vact' => '가상계좌', default => $m ?: '-', }; }; $statusLabel = function () use ($attempt, $order) { $aCancel = (string)($attempt['cancel_status'] ?? 'none'); $oCancel = (string)($order['cancel_status'] ?? 'none'); if ($aCancel === 'success' || $oCancel === 'success') return '결제취소'; $aStatus = (string)($attempt['status'] ?? ''); $oPay = (string)($order['stat_pay'] ?? ''); if ($aStatus === 'paid' || $oPay === 'p') return '결제완료'; if ($aStatus === 'issued' || $oPay === 'w') return '입금대기'; if ($aStatus === 'failed' || $oPay === 'f') return '결제실패'; return '진행중'; }; $st = $statusLabel(); $isCancelledAfterPaid = ($st === '결제취소'); $statusClass = function ($label) { return match ($label) { '결제취소' => 'pill--danger', '결제완료' => 'pill--ok', '입금대기' => 'pill--wait', '결제실패' => 'pill--danger', default => 'pill--muted', }; }; $attemptId = (int)($attempt['id'] ?? 0); $oid = (string)($order['oid'] ?? ''); $method = (string)($order['pay_method'] ?? ($attempt['pay_method'] ?? '')); $methodKor = $methodLabel($method); $amounts = (array)($order['amounts'] ?? []); $subtotal = (int)($amounts['subtotal'] ?? 0); $fee = (int)($amounts['fee'] ?? 0); $payMoney = (int)($amounts['pay_money'] ?? 0); $productName = (string)($productname ?? ''); if ($productName === '') $productName = '-'; $itemName = (string)($items[0]['name'] ?? ''); if ($itemName === '') $itemName = '-'; $totalQty = 0; foreach ($items as $it) $totalQty += (int)($it['qty'] ?? 0); $createdAt = (string)($order['created_at'] ?? ($attempt['created_at'] ?? '')); $dateStr = $createdAt ? \Carbon\Carbon::parse($createdAt)->format('Y-m-d H:i') : '-'; $showPinsNow = true; $isPinIssuedCompleted = (bool)($pinsIssuedCompleted ?? !empty($pins)); $useRightBannerMode = $isCancelledAfterPaid || $isPinIssuedCompleted; $issueMethods = $issueMethods ?? ['PIN_INSTANT','SMS','BUYBACK']; if (is_string($issueMethods)) $issueMethods = json_decode($issueMethods, true) ?: []; if (!is_array($issueMethods) || empty($issueMethods)) $issueMethods = ['PIN_INSTANT','SMS','BUYBACK']; $issueAllowed = array_fill_keys($issueMethods, true); $issueMissing = $issueMissing ?? []; if (is_string($issueMissing)) $issueMissing = json_decode($issueMissing, true) ?: []; if (!is_array($issueMissing)) $issueMissing = []; $issueMap = [ 'PIN_INSTANT' => '핀번호 바로 확인', 'SMS' => 'SMS 발송', 'BUYBACK' => '구매상품권 판매', ]; $issueMissingLabels = []; foreach ($issueMissing as $k) { if (isset($issueMap[$k])) $issueMissingLabels[] = $issueMap[$k]; } $issueOpenKey = (count($issueMethods) === 1) ? ($issueMethods[0] ?? null) : null; @endphp @section('title', '구매내역 상세') @section('subcontent')
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif
← 목록
결제 영수증
{{ $dateStr }} · {{ $methodKor }}
{{ $st }}
{{ $productName }} [ {{ $itemName }} ]
결제번호 #{{ $attemptId ?: '-' }}
주문번호 {{ $oid ?: '-' }}
결제수단 {{ $methodKor }}
수량 {{ $totalQty }}
상품금액 {{ number_format($subtotal) }}원
고객수수료 {{ number_format($fee) }}원
결제금액 {{ number_format($payMoney) }}원
@if(!$isCancelledAfterPaid) @if($showPinsNow && $hasIssuedIssues)

핀번호

기본은 마스킹 상태로 표시됩니다. 핀번호 확인 버튼에서 2차 비밀번호를 입력하면 이번 화면에서만 전체 핀번호를 확인할 수 있습니다.
@if($pinsRevealed) 핀번호 확인됨 @else 마스킹 표시중 @endif
@if(empty($pins))

표시할 핀이 없습니다.

@else
@foreach($pins as $idx => $p) @php $raw = (string)($p['pin'] ?? ''); $masked = (string)($p['pin_mask'] ?? '****'); $display = $pinsRevealed ? ($raw ?: $masked) : $masked; $amount = number_format((int)($p['face_value'] ?? 0)); @endphp
MOBILE GIFT
No. {{ $idx + 1 }}
{{ $productName }}
{{ $amount }}원
PIN NUMBER
{{ $display }}
핀번호는 본인만 확인해 주세요.
핀 발행이 완료된 주문은 회원이 직접 취소할 수 없습니다.
@endforeach
@if(!$pinsRevealed)
@else
@endif @endif
@endif @if($canCancel)

결제 취소

취소 사유를 선택한 뒤 결제를 취소할 수 있습니다.
@csrf
@endif @endif
@endsection