<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class XenditLink extends Model
{
    use HasFactory;

    protected $fillable = [
        "uid",
        "invoice_url",
        "user_id",
        "external_id",
        "status",
        "amount",
        "received_amount",
        "expiry_date",
        "payment_id",
        "paid_amount",
        "payment_method",
        "bank_code",
        "payment_channel",
        "payment_destination",
        "paid_at"
    ];

    public function payment()
    {
        return $this->morphOne(TransactionPayment::class,"method");
    }
}
