PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.3.21
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.3.21
1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 All 49 releases
fluent-cart / app / Modules / PaymentMethods / SquareGateway / SquareSettingsBase.php

SquareSettingsBase.php in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.3.21, at app/Modules/PaymentMethods/SquareGateway/SquareSettingsBase.php

65 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentCart\App\Modules\PaymentMethods\SquareGateway;
4
5 use FluentCart\App\Modules\PaymentMethods\Core\BaseGatewaySettings;
6 use FluentCart\App\Helpers\Helper;
7 use FluentCart\Framework\Support\Arr;
8
9 class SquareSettingsBase extends BaseGatewaySettings
10 {
11 public $settings;
12 public $methodHandler = 'fluent_cart_payment_settings_square';
13
14
15 public static function getDefaults()
16 {
17 return [
18 'is_active' => 'no',
19 'application_id' => '',
20 'access_token' => '',
21 'location_id' => '',
22 'webhook_signature_key' => '',
23 'payment_mode' => 'sandbox',
24 ];
25 }
26
27 public function isActive(): bool
28 {
29 return $this->settings['is_active'] == 'yes';
30 }
31
32 public function get($key = '')
33 {
34 if ($key && isset($this->settings[$key])) {
35 return $this->settings[$key];
36 }
37 return $this->settings;
38 }
39
40 public function getMode()
41 {
42 return $this->get('payment_mode');
43 }
44
45 public function getApplicationId()
46 {
47 return $this->get('application_id');
48 }
49
50 public function getAccessToken()
51 {
52 return Helper::decryptKey($this->get('access_token'));
53 }
54
55 public function getLocationId()
56 {
57 return $this->get('location_id');
58 }
59
60 public function getWebhookSignatureKey()
61 {
62 return Helper::decryptKey($this->get('webhook_signature_key'));
63 }
64 }
65