@extends('web.layouts.subpage')
@php
// 탭 활성화용
$mypageActive = $mypageActive ?? 'usage';
@endphp
@section('title', $pageTitle ?? '구매내역')
@section('subcontent')
@if(($mode ?? 'empty') === 'empty')
결제 완료 후 이 페이지에서 핀 확인/발급/매입을 진행할 수 있습니다.
결제 완료 페이지에서 자동으로 이동되며, attempt_id가 없으면 상세 정보를 표시할 수 없습니다.
@else
{{-- 상태 스텝 --}}
@foreach(($steps ?? []) as $st)
@php
$active = false;
$done = false;
// 표시 규칙(간단): 현재 stepKey 기준으로 active 표시
$active = (($stepKey ?? '') === $st['key']);
// 완료표시(선택): deposit_wait 이전/이후 같은 세밀한 건 다음 단계에서 고도화 가능
// 여기서는 "active 이전"을 done으로 찍지 않고, 필요하면 확장
@endphp
@endforeach
{{-- 결제/주문 요약 --}}
주문/결제 정보
주문번호 {{ $order['oid'] ?? '-' }}
결제수단 {{ $order['pay_method'] ?? '-' }}
결제상태 {{ $order['stat_pay'] ?? '-' }}
PG TID {{ $order['pg_tid'] ?? ($attempt['pg_tid'] ?? '-') }}
결제일시 {{ $order['created_at'] ?? '-' }}
상품금액 {{ number_format($order['amounts']['subtotal'] ?? 0) }}원
고객수수료 {{ number_format($order['amounts']['fee'] ?? 0) }}원
결제금액 {{ number_format($order['amounts']['pay_money'] ?? 0) }}원
@if(!empty($vactInfo))
가상계좌 안내
은행 {{ $vactInfo['bank'] ?? '-' }}
계좌번호 {{ $vactInfo['account'] ?? '-' }}
예금주 {{ $vactInfo['holder'] ?? '-' }}
입금금액 {{ is_numeric($vactInfo['amount'] ?? null) ? number_format((int)$vactInfo['amount']).'원' : ($vactInfo['amount'] ?? '-') }}
만료 {{ $vactInfo['expire_at'] ?? '-' }}
@endif
{{-- 아이템 --}}
구매 상품
@foreach(($items ?? []) as $it)
{{ $it['name'] }}
수량 {{ $it['qty'] }}
{{ number_format($it['unit'] ?? 0) }}원
합계 {{ number_format($it['total'] ?? 0) }}원
@endforeach
{{-- 핀 발급 상태/액션 (결제완료에서만 활성) --}}
핀 발급/전달
필요 핀 수량 {{ (int)($requiredQty ?? 0) }}개
할당된 핀 {{ (int)($assignedPinsCount ?? 0) }}개
@if(!empty($pinsSummary))
@foreach($pinsSummary as $st => $cnt)
{{ $st }}: {{ $cnt }}
@endforeach
@endif
@php
$isPaid = (($order['stat_pay'] ?? '') === 'p') || (($attempt['status'] ?? '') === 'paid');
$isVactWait = (($order['stat_pay'] ?? '') === 'w') || (($attempt['status'] ?? '') === 'issued');
$isFailed = in_array(($order['stat_pay'] ?? ''), ['c','f'], true) || in_array(($attempt['status'] ?? ''), ['cancelled','failed'], true);
@endphp
@if($isVactWait)
가상계좌 입금 확인 후 핀 발급을 진행할 수 있습니다.
@elseif($isFailed)
결제가 취소/실패 상태입니다. 결제 정보를 확인해 주세요.
@elseif($isPaid)
핀번호 SMS 발송
핀번호 바로 확인
핀번호 되팔기(매입)
※ 사고 방지를 위해 핀 노출/발송/매입은 모두 서버 검증 후 처리됩니다.
@else
결제 진행 중이거나 확인 중입니다. 잠시 후 다시 확인해 주세요.
@endif
{{-- 디버그(접기) --}}
결제 상세(디버그)
{{ json_encode(['attempt'=>$attempt,'order'=>$order], JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES) }}
@endif
@endsection