Add optional owner gateway routing to Merchant.
Deploy Ladill Merchant / deploy (push) Successful in 44s
Deploy Ladill Merchant / deploy (push) Successful in 44s
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?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_');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user