Deploy Ladill Give / deploy (push) Successful in 1m0s
Co-authored-by: Cursor <cursoragent@cursor.com>
31 lines
797 B
PHP
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_');
|
|
}
|
|
}
|