| 1 |
<?php |
| 2 |
|
| 3 |
namespace FluentCart\App\Modules\PaymentMethods\AirwallexGateway; |
| 4 |
|
| 5 |
use FluentCart\App\Modules\PaymentMethods\Core\BaseGatewaySettings; |
| 6 |
use FluentCart\App\Helpers\Helper; |
| 7 |
use FluentCart\Framework\Support\Arr; |
| 8 |
|
| 9 |
class AirwallexSettingsBase extends BaseGatewaySettings |
| 10 |
{ |
| 11 |
public $settings; |
| 12 |
public $methodHandler = 'fluent_cart_payment_settings_airwallex'; |
| 13 |
|
| 14 |
public static function getDefaults() |
| 15 |
{ |
| 16 |
return [ |
| 17 |
'is_active' => 'no', |
| 18 |
'test_client_id' => '', |
| 19 |
'live_client_id' => '', |
| 20 |
'test_api_key' => '', |
| 21 |
'live_api_key' => '', |
| 22 |
'payment_mode' => 'test', |
| 23 |
]; |
| 24 |
} |
| 25 |
|
| 26 |
public function isActive(): bool |
| 27 |
{ |
| 28 |
return $this->settings['is_active'] == 'yes'; |
| 29 |
} |
| 30 |
|
| 31 |
public function get($key = '') |
| 32 |
{ |
| 33 |
if ($key && isset($this->settings[$key])) { |
| 34 |
return $this->settings[$key]; |
| 35 |
} |
| 36 |
return $this->settings; |
| 37 |
} |
| 38 |
|
| 39 |
public function getMode() |
| 40 |
{ |
| 41 |
return $this->get('payment_mode'); |
| 42 |
} |
| 43 |
|
| 44 |
public function getClientId() |
| 45 |
{ |
| 46 |
return $this->get('client_id'); |
| 47 |
} |
| 48 |
|
| 49 |
public function getApiKey() |
| 50 |
{ |
| 51 |
return Helper::decryptKey($this->get('api_key')); |
| 52 |
} |
| 53 |
|
| 54 |
public function getWebhookSecret() |
| 55 |
{ |
| 56 |
return Helper::decryptKey($this->get('webhook_secret')); |
| 57 |
} |
| 58 |
} |
| 59 |
|