fix(ecommerce,tosspayments,pay_kginicis,core): 리베이스 접합부 payment_method string 계약 미전파 회귀 수정
develop 가 확장 결제수단 ID 허용을 위해 OrderPayment.payment_method 의 enum 캐스트를 제거했으나, 리베이스에서 텍스트 충돌이 없던 브랜치 소유 코드 4곳이 enum 전제 그대로 병합되어 string===enum(항상 false)·string 메서드 호출 (fatal)로 잠복했다. 부분취소/환불 재계산 fatal, 무통장 입금완료 현금영수증 자동발급 무동작, 토스 가상계좌 환불 수취계좌 미전송이 이에 해당하며, 전부 develop 기존 관용구(tryFrom/능력 메서드/->value)로 수렴해 해소. IDV getStatus 의 리베이스 잔재 주석(코드와 모순)도 사실에 맞게 정정. 검증: ecommerce 235/235 · tosspayments 19/19 · pay_kginicis 5/5 green, audit --working 0, 활성 반영(module/plugin:update --force) 완료.
This commit is contained in:
@@ -199,9 +199,10 @@ class IdentityVerificationService
|
||||
$publicPayload = $log->properties['public_payload'];
|
||||
}
|
||||
|
||||
// 시도 횟수(attempts / max_attempts) 는 노출하지 않는다.
|
||||
// 누적 시도 횟수(attempts) 는 노출하지 않는다.
|
||||
// 이 엔드포인트는 권한 가드 없는 공개 폴링용이라 challenge id 만 알면 누구나 조회할 수 있고,
|
||||
// 두 값을 함께 알면 남은 시도 횟수를 정확히 계산해 무차별 대입 시점을 노릴 수 있다.
|
||||
// 남의 인증 시도 실패 횟수가 드러나면 잠금 직전까지 시도 횟수를 맞춰 보는 데 쓰일 수 있다.
|
||||
// 상한(max_attempts) 은 정책 상수라 노출해도 무방하다 — 아래 반환 배열의 주석 참조.
|
||||
return [
|
||||
'id' => $log->id,
|
||||
'status' => $log->status->value,
|
||||
|
||||
@@ -183,16 +183,6 @@ class OrderPayment extends Model
|
||||
return CashReceiptType::fromLegacy($this->cash_receipt_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* 무통장입금 결제 여부 확인
|
||||
*
|
||||
* @return bool 무통장입금 결제 여부
|
||||
*/
|
||||
public function isBankDeposit(): bool
|
||||
{
|
||||
return $this->payment_method === PaymentMethodEnum::DBANK;
|
||||
}
|
||||
|
||||
/**
|
||||
* 카드 결제 여부 확인
|
||||
*
|
||||
|
||||
@@ -8,7 +8,6 @@ use Modules\Sirsoft\Ecommerce\Enums\CashReceiptIdentifierType;
|
||||
use Modules\Sirsoft\Ecommerce\Enums\CashReceiptIssueStatus;
|
||||
use Modules\Sirsoft\Ecommerce\Enums\CashReceiptTransactionType;
|
||||
use Modules\Sirsoft\Ecommerce\Enums\CashReceiptType;
|
||||
use Modules\Sirsoft\Ecommerce\Enums\PaymentMethodEnum;
|
||||
use Modules\Sirsoft\Ecommerce\Enums\PaymentStatusEnum;
|
||||
use Modules\Sirsoft\Ecommerce\Models\Order;
|
||||
use Modules\Sirsoft\Ecommerce\Models\OrderCashReceipt;
|
||||
@@ -461,7 +460,7 @@ class CashReceiptService
|
||||
return 'PAYMENT_NOT_FOUND';
|
||||
}
|
||||
|
||||
if ($payment->payment_method !== PaymentMethodEnum::DBANK) {
|
||||
if (! $payment->isBankTransfer()) {
|
||||
return 'NOT_CASH_PAYMENT';
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ use Modules\Sirsoft\Ecommerce\DTO\OrderCalculationResult;
|
||||
use Modules\Sirsoft\Ecommerce\DTO\ShippingAddress;
|
||||
use Modules\Sirsoft\Ecommerce\Enums\CouponIssueRecordStatus;
|
||||
use Modules\Sirsoft\Ecommerce\Enums\OrderStatusEnum;
|
||||
use Modules\Sirsoft\Ecommerce\Enums\PaymentMethodEnum;
|
||||
use Modules\Sirsoft\Ecommerce\Enums\RefundPriorityEnum;
|
||||
use Modules\Sirsoft\Ecommerce\Models\Order;
|
||||
use Modules\Sirsoft\Ecommerce\Repositories\Contracts\CouponIssueRepositoryInterface;
|
||||
@@ -833,7 +834,11 @@ class OrderAdjustmentService
|
||||
{
|
||||
$order->loadMissing('payment');
|
||||
|
||||
return $order->payment?->payment_method?->resolveCashEquivalentAmount($finalAmount) ?? 0;
|
||||
// payment_method 는 순수 string (#475 — 확장 결제수단 ID 허용). 코어 enum 에 없는
|
||||
// 확장 결제수단은 현금성 0 으로 판정한다 (OrderProcessingService 와 동일 idiom).
|
||||
return PaymentMethodEnum::tryFrom($order->payment?->paymentMethodId() ?? '')
|
||||
?->resolveCashEquivalentAmount($finalAmount)
|
||||
?? 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -141,7 +141,7 @@ class ApiDocSampleService implements ApiDocSampleSeeder
|
||||
'transaction_id' => self::SAMPLE_TID,
|
||||
'merchant_order_id' => 'MO-'.self::SAMPLE_ORDER_NUMBER,
|
||||
'payment_status' => PaymentStatusEnum::PAID,
|
||||
'payment_method' => PaymentMethodEnum::VBANK,
|
||||
'payment_method' => PaymentMethodEnum::VBANK->value,
|
||||
'is_escrow' => true,
|
||||
'buyer_name' => 'API 문서 샘플 구매자',
|
||||
'buyer_email' => 'apidoc-sample-user@example.com',
|
||||
|
||||
@@ -4,7 +4,6 @@ namespace Plugins\Sirsoft\Tosspayments\Listeners;
|
||||
|
||||
use App\Contracts\Extension\HookListenerInterface;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Modules\Sirsoft\Ecommerce\Enums\PaymentMethodEnum;
|
||||
use Modules\Sirsoft\Ecommerce\Models\Order;
|
||||
use Modules\Sirsoft\Ecommerce\Models\OrderPayment;
|
||||
use Modules\Sirsoft\Ecommerce\Models\OrderRefund;
|
||||
@@ -257,7 +256,7 @@ class PaymentRefundListener implements HookListenerInterface
|
||||
*/
|
||||
private function requiresRefundReceiveAccount(OrderPayment $payment): bool
|
||||
{
|
||||
return $payment->payment_method === PaymentMethodEnum::VBANK;
|
||||
return $payment->isVirtualAccount();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user