<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class IshareOrderPayment extends Model
{
    protected $table = 'ishare_order_payments';

    protected $fillable = [
        'order_id',
        'contact',
        'amount',
        'profit',
        'transaction_id',
        'payment_provider_id',
        'status',
    ];

    /**
     * Get the order that owns the payment
     */
    public function order()
    {
        return $this->belongsTo(IshareOrder::class, 'order_id', 'id');
    }

    public function paymentProvider()
    {
        return $this->belongsTo(PaymentProvider::class, 'payment_provider_id');
    }
}