Add Ladill POS v1 — register, Pay checkout, and commerce links.
Deploy Ladill Mini / deploy (push) Successful in 23s
Deploy Ladill Mini / deploy (push) Successful in 23s
Staff-facing counter register at pos.ladill.com with catalog cart, cash and MoMo/card checkout via Ladill Pay, CRM timeline/import, invoice prefill, and Merchant catalog import. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
<?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';
|
||||
public const STATUS_CANCELED = 'canceled';
|
||||
|
||||
/** Pending payments are auto-canceled after this many hours. */
|
||||
public const STALE_PENDING_HOURS = 6;
|
||||
|
||||
/** Platform fee on trader payments (Ladill Mini tier). */
|
||||
public const PLATFORM_FEE_RATE = 0.035;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user