From fdf6adf501cc5cdd06e5234740ef8a5eb1bb5c06 Mon Sep 17 00:00:00 2001 From: Nurmuhammet Allanov Date: Wed, 26 Mar 2025 14:17:06 +0500 Subject: [PATCH] wip --- app/Models/Order/Card/CardOrder.php | 7 ++++++- app/Repos/Payment/OnlinePaymentRepo.php | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/Models/Order/Card/CardOrder.php b/app/Models/Order/Card/CardOrder.php index f438753..ef620d6 100644 --- a/app/Models/Order/Card/CardOrder.php +++ b/app/Models/Order/Card/CardOrder.php @@ -125,7 +125,12 @@ class CardOrder extends Model */ public function priceAmount(): float { - return $this->cardState->price ?? floatval(32); + return $this->cardState->price ?? 32; + } + + public function really() + { + return $this->id; } /** diff --git a/app/Repos/Payment/OnlinePaymentRepo.php b/app/Repos/Payment/OnlinePaymentRepo.php index 0b5d794..702ee35 100644 --- a/app/Repos/Payment/OnlinePaymentRepo.php +++ b/app/Repos/Payment/OnlinePaymentRepo.php @@ -3,6 +3,7 @@ namespace App\Repos\Payment; use App\Models\Branch\Branch; +use App\Models\Order\Card\CardOrder; use App\Models\Payment\OnlinePaymentHistory; use App\Repos\Payment\Billing\HandlesBillingSyncing; use App\Repos\Payment\Card\HandlesCardOrderPayments; @@ -129,8 +130,8 @@ class OnlinePaymentRepo } $onlinePaymentHistory = new OnlinePaymentHistory; - $onlinePaymentHistory->online_paymantable_id = $resource->id; - $onlinePaymentHistory->online_paymantable_type = $resource::$model; + $onlinePaymentHistory->online_paymantable_id = $resource->really(); + $onlinePaymentHistory->online_paymantable_type = CardOrder::class; $onlinePaymentHistory->amount = $resource->priceAmount(); $onlinePaymentHistory->orderNumber = $orderNumber; $onlinePaymentHistory->description = 'Kart tölegi';