33 lines
747 B
PHP
33 lines
747 B
PHP
<?php
|
|
|
|
namespace Apoloz\AlfaBank;
|
|
|
|
use Apoloz\AlfaBank\Enums\Environment;
|
|
use Saloon\Http\Connector;
|
|
use Saloon\Traits\Plugins\HasTimeout;
|
|
|
|
class AlfaBankConnector extends Connector
|
|
{
|
|
use HasTimeout;
|
|
|
|
public function __construct(
|
|
protected string $certificatePath,
|
|
protected string $privateKeyPath,
|
|
protected Environment $environment = Environment::PRODUCTION
|
|
) {}
|
|
|
|
public function resolveBaseUrl(): string
|
|
{
|
|
return $this->environment->value;
|
|
}
|
|
|
|
protected function defaultConfig(): array
|
|
{
|
|
return [
|
|
'cert' => $this->certificatePath,
|
|
'ssl_key' => $this->privateKeyPath,
|
|
'verify' => true, // Ensure SSL verification is on
|
|
];
|
|
}
|
|
}
|