Deploy Ladill Mini / deploy (push) Successful in 29s
Checkout and settlement now go via platform Pay instead of direct Paystack + Billing credit, with legacy MIN-* support retained. Co-authored-by: Cursor <cursoragent@cursor.com>
59 lines
1.3 KiB
PHP
59 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class MiniPayment extends Model
|
|
{
|
|
public const STATUS_PENDING = 'pending';
|
|
public const STATUS_PAID = 'paid';
|
|
public const STATUS_FAILED = 'failed';
|
|
|
|
/** Platform fee on trader payments (Ladill Mini tier). */
|
|
public const PLATFORM_FEE_RATE = 0.05;
|
|
|
|
protected $fillable = [
|
|
'pay_order_id',
|
|
'qr_code_id',
|
|
'user_id',
|
|
'reference',
|
|
'amount_minor',
|
|
'currency',
|
|
'platform_fee_minor',
|
|
'merchant_amount_minor',
|
|
'payer_name',
|
|
'payer_email',
|
|
'payer_phone',
|
|
'payer_note',
|
|
'status',
|
|
'payment_reference',
|
|
'paid_at',
|
|
'metadata',
|
|
];
|
|
|
|
protected $casts = [
|
|
'amount_minor' => 'integer',
|
|
'platform_fee_minor' => 'integer',
|
|
'merchant_amount_minor' => 'integer',
|
|
'metadata' => 'array',
|
|
'paid_at' => 'datetime',
|
|
];
|
|
|
|
public function qrCode(): BelongsTo
|
|
{
|
|
return $this->belongsTo(QrCode::class);
|
|
}
|
|
|
|
public function merchant(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'user_id');
|
|
}
|
|
|
|
public function amountMajor(): float
|
|
{
|
|
return $this->amount_minor / 100;
|
|
}
|
|
}
|