Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -39,12 +39,13 @@ class PaymentGatewaySetting extends Model
|
||||
return false;
|
||||
}
|
||||
|
||||
$public = trim((string) $this->public_key);
|
||||
$secret = trim((string) $this->secret_key);
|
||||
|
||||
return $secret !== '' && in_array($this->provider, [
|
||||
self::PROVIDER_PAYSTACK,
|
||||
self::PROVIDER_FLUTTERWAVE,
|
||||
self::PROVIDER_HUBTEL,
|
||||
], true);
|
||||
return match ($this->provider) {
|
||||
self::PROVIDER_PAYSTACK => str_starts_with($public, 'pk_') && str_starts_with($secret, 'sk_'),
|
||||
self::PROVIDER_FLUTTERWAVE, self::PROVIDER_HUBTEL => $public !== '' && $secret !== '',
|
||||
default => false,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user