Files
ladill-give/app/Models/PaymentGatewaySetting.php
isaaccladandCursor e5d95167dd
Deploy Ladill Give / deploy (push) Successful in 1m0s
Add optional owner gateway routing to Give.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-21 19:47:13 +00:00

31 lines
797 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class PaymentGatewaySetting extends Model
{
public const PROVIDER_PAYSTACK = 'paystack';
protected $fillable = ['owner_ref', 'provider', 'public_key', 'secret_key', 'is_active', 'metadata'];
protected function casts(): array
{
return [
'public_key' => 'encrypted',
'secret_key' => 'encrypted',
'is_active' => 'boolean',
'metadata' => 'array',
];
}
public function isConfigured(): bool
{
return $this->is_active
&& $this->provider === self::PROVIDER_PAYSTACK
&& str_starts_with(trim((string) $this->public_key), 'pk_')
&& str_starts_with(trim((string) $this->secret_key), 'sk_');
}
}