This commit is contained in:
2025-03-26 14:17:06 +05:00
parent 78a91604b1
commit fdf6adf501
2 changed files with 9 additions and 3 deletions

View File

@@ -125,7 +125,12 @@ class CardOrder extends Model
*/ */
public function priceAmount(): float public function priceAmount(): float
{ {
return $this->cardState->price ?? floatval(32); return $this->cardState->price ?? 32;
}
public function really()
{
return $this->id;
} }
/** /**

View File

@@ -3,6 +3,7 @@
namespace App\Repos\Payment; namespace App\Repos\Payment;
use App\Models\Branch\Branch; use App\Models\Branch\Branch;
use App\Models\Order\Card\CardOrder;
use App\Models\Payment\OnlinePaymentHistory; use App\Models\Payment\OnlinePaymentHistory;
use App\Repos\Payment\Billing\HandlesBillingSyncing; use App\Repos\Payment\Billing\HandlesBillingSyncing;
use App\Repos\Payment\Card\HandlesCardOrderPayments; use App\Repos\Payment\Card\HandlesCardOrderPayments;
@@ -129,8 +130,8 @@ class OnlinePaymentRepo
} }
$onlinePaymentHistory = new OnlinePaymentHistory; $onlinePaymentHistory = new OnlinePaymentHistory;
$onlinePaymentHistory->online_paymantable_id = $resource->id; $onlinePaymentHistory->online_paymantable_id = $resource->really();
$onlinePaymentHistory->online_paymantable_type = $resource::$model; $onlinePaymentHistory->online_paymantable_type = CardOrder::class;
$onlinePaymentHistory->amount = $resource->priceAmount(); $onlinePaymentHistory->amount = $resource->priceAmount();
$onlinePaymentHistory->orderNumber = $orderNumber; $onlinePaymentHistory->orderNumber = $orderNumber;
$onlinePaymentHistory->description = 'Kart tölegi'; $onlinePaymentHistory->description = 'Kart tölegi';