e13df69885
API CI/CD / Validate (composer + pint) (push) Successful in 3m6s
API CI/CD / Test (PHPUnit) (push) Failing after 4m53s
API CI/CD / Build frontend assets (push) Successful in 1m2s
API CI/CD / Security audit (push) Failing after 59s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
28 lines
910 B
PHP
28 lines
910 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
class PaypalTransaction extends BaseModel
|
|
{
|
|
protected $table = 'paypal_transactions';
|
|
|
|
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
|
public $timestamps = true;
|
|
|
|
protected $fillable = ['transaction_id', 'payment_id', 'firstname', 'lastname', 'event_type', 'payer_email', 'amount', 'currency', 'status', 'payment_method', 'transaction_fee', 'raw_data', 'created_at', 'updated_at', 'school_year', 'semester'];
|
|
|
|
protected $casts = [
|
|
'payment_id' => 'integer',
|
|
'amount' => 'decimal:2', // adjust precision if needed
|
|
'transaction_fee' => 'decimal:2', // adjust precision if needed
|
|
// raw_data is often JSON; if it's JSON in DB, cast to array
|
|
'raw_data' => 'array',
|
|
];
|
|
|
|
/* Optional relationship */
|
|
public function payment()
|
|
{
|
|
return $this->belongsTo(Payment::class, 'payment_id');
|
|
}
|
|
}
|