refactor: improve sandbox configuration parsing

This commit is contained in:
idevakk
2025-12-10 03:28:00 +05:30
parent 9307b4e3e4
commit 29b20a3856

View File

@@ -35,7 +35,7 @@ class OxapayProvider implements PaymentProviderContract
$config = array_merge($dbConfig, $config); $config = array_merge($dbConfig, $config);
$this->config = $config; $this->config = $config;
$this->sandbox = (bool) ($config['sandbox'] ?? false); $this->sandbox = $config['sandbox'] === "true" ?? false;
$this->merchantApiKey = $this->sandbox ? ($config['sandbox_merchant_api_key'] ?? '') : ($config['merchant_api_key'] ?? ''); $this->merchantApiKey = $this->sandbox ? ($config['sandbox_merchant_api_key'] ?? '') : ($config['merchant_api_key'] ?? '');
$this->baseUrl = 'https://api.oxapay.com/v1'; $this->baseUrl = 'https://api.oxapay.com/v1';