<?php

namespace Mehrab\Payment\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Mehrab\Media\Models\Media;
use Mehrab\Region\Models\Region;
use Mehrab\User\Models\User;

class Payment extends Model
{
    protected $table = 'payment';

    const STATUS_PENDING = 'pending';
    const STATUS_SUCCESS = 'success';
    const STATUS_FAIL = 'fail';
    const STATUS_CANCELED = 'canceled';
    public static $status = [
        self::STATUS_PENDING,
        self::STATUS_CANCELED,
        self::STATUS_SUCCESS,
        self::STATUS_FAIL,
    ];

    use HasFactory;

    protected $fillable = [
        "customer_id",
        "paymentable_id",
        "paymentable_type",
        "invoice_id",
        "amount",
        "seller_id",
        "gateway",
        "expert_Share",
        "team_leader_Share",
        "site_Share",
        "seller_percent",
        "status",
    ];

    public function paymentable(){
        return $this->morphTo('paymentable');
    }

    public function customer(){
        return $this->belongsTo(User::class);
    }

    public function seller(){
        return $this->belongsTo(User::class);
    }


}
