← All changes
|
includes/Core/Integration/SendFox/SendFoxHandler.php
+12
-6
2.0
→
2.15.3
View file →
| @@ -9,22 +9,26 @@ | ||
| 9 | 9 | use BitCode\BitForm\Core\Integration\IntegrationHandler; |
| 10 | 10 | use BitCode\BitForm\Core\Util\HttpHelper; |
| 11 | 11 | use WP_Error; |
| 12 | 12 | |
| 13 | -class SendFoxHandler { | |
| 13 | +class SendFoxHandler | |
| 14 | +{ | |
| 14 | 15 | private $integrationID; |
| 15 | 16 | public static $baseUrl = 'https://api.sendfox.com/'; |
| 16 | 17 | |
| 17 | - public function __construct($integrationID, $fromID) { | |
| 18 | + public function __construct($integrationID, $fromID) | |
| 19 | + { | |
| 18 | 20 | $this->integrationID = $integrationID; |
| 19 | 21 | } |
| 20 | 22 | |
| 21 | - public static function registerAjax() { | |
| 23 | + public static function registerAjax() | |
| 24 | + { | |
| 22 | 25 | add_action('wp_ajax_bitforms_sendFox_authorize', [__CLASS__, 'sendFoxAuthorize']); |
| 23 | 26 | add_action('wp_ajax_bitforms_sendfox_fetch_all_list', [__CLASS__, 'fetchContactLists']); |
| 24 | 27 | } |
| 25 | 28 | |
| 26 | - public static function sendFoxAuthorize($requestParams) { | |
| 29 | + public static function sendFoxAuthorize($requestParams) | |
| 30 | + { | |
| 27 | 31 | if (!isset($_REQUEST['_ajax_nonce']) && !wp_verify_nonce($_REQUEST['_ajax_nonce'], 'bitforms_save')) { |
| 28 | 32 | wp_send_json_error(__('Token expired', 'bit-form'), 401); |
| 29 | 33 | } |
| 30 | 34 | |
| @@ -55,9 +59,10 @@ | ||
| 55 | 59 | ); |
| 56 | 60 | } |
| 57 | 61 | } |
| 58 | 62 | |
| 59 | - public static function fetchContactLists($requestParams) { | |
| 63 | + public static function fetchContactLists($requestParams) | |
| 64 | + { | |
| 60 | 65 | if (!isset($_REQUEST['_ajax_nonce']) && !wp_verify_nonce($_REQUEST['_ajax_nonce'], 'bitforms_save')) { |
| 61 | 66 | wp_send_json_error(__('Token expired', 'bit-form'), 401); |
| 62 | 67 | } |
| 63 | 68 | |
| @@ -91,9 +96,10 @@ | ||
| 91 | 96 | ); |
| 92 | 97 | } |
| 93 | 98 | } |
| 94 | 99 | |
| 95 | - public function execute(IntegrationHandler $integrationHandler, $integrationData, $fieldValues, $entryID, $logID) { | |
| 100 | + public function execute(IntegrationHandler $integrationHandler, $integrationData, $fieldValues, $entryID, $logID) | |
| 101 | + { | |
| 96 | 102 | $integrationDetails = json_decode($integrationData->integration_details); |
| 97 | 103 | $access_token = $integrationDetails->access_token; |
| 98 | 104 | $listId = $integrationDetails->listId; |
| 99 | 105 | $mainAction = $integrationDetails->mainAction; |