Working on credit card
This commit is contained in:
@@ -47,6 +47,7 @@ class CardOrder extends Model
|
||||
'passport_two',
|
||||
'passport_three',
|
||||
'passport_four',
|
||||
'paid',
|
||||
'notes',
|
||||
'user_id',
|
||||
];
|
||||
@@ -101,6 +102,22 @@ class CardOrder extends Model
|
||||
parent::boot();
|
||||
|
||||
static::creating(CardOrderRepo::creating());
|
||||
static::created(CardOrderRepo::created());
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if order is paid
|
||||
*/
|
||||
public function isPaid(): bool
|
||||
{
|
||||
return $this->paid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Price for order
|
||||
*/
|
||||
public function priceAmount(): float
|
||||
{
|
||||
return 1;
|
||||
// return floatval($this->cardType->price);
|
||||
}
|
||||
}
|
||||
|
||||
46
app/Models/Payment/OnlinePaymentHistory.php
Normal file
46
app/Models/Payment/OnlinePaymentHistory.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Payment;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class OnlinePaymentHistory extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* Table name
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'online_payment_histories';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'refunded_amount',
|
||||
'booking_number',
|
||||
'amount',
|
||||
'depositedAmount',
|
||||
'orderNumber',
|
||||
'description',
|
||||
'orderId',
|
||||
'cardholderName',
|
||||
'pan',
|
||||
'approvalCode',
|
||||
'expiration',
|
||||
'formUrl',
|
||||
'successUrl',
|
||||
'errorUrl',
|
||||
'api_client',
|
||||
'paymentStatus',
|
||||
'callbackStatus',
|
||||
'username',
|
||||
'online_paymantable_id',
|
||||
'online_paymantable_type',
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user