PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 1.2
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v1.2
V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 2.10.2 All 137 releases
bit-form / includes / Core / Util / ApiResponse.php

ApiResponse.php in Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder 1.2, at includes/Core/Util/ApiResponse.php

34 lines 989 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace BitCode\BitForm\Core\Util;
4
5 use BitCode\BitForm\Core\Database\FormEntryLogModel;
6 use BitCode\BitForm\Core\Util\IpTool;
7
8 final class ApiResponse
9 {
10 public function apiResponse($logID, $integrationId, $apiType, $responseType, $responseObj)
11 {
12 if (!$apiType || !$responseObj) {
13 return false;
14 }
15 $apiType = wp_json_encode($apiType);
16 $responseObj = wp_json_encode($responseObj);
17
18 $ipTool = new IpTool();
19 $user_details = $ipTool->getUserDetail();
20 $formEntryModel = new FormEntryLogModel();
21 $result = $formEntryModel->log_history_insert(
22 array(
23 "log_id" => $logID,
24 "integration_id" => $integrationId,
25 "api_type" => $apiType,
26 "response_type" => $responseType,
27 "response_obj" => $responseObj,
28 "created_at" => $user_details['time'],
29 )
30 );
31 return $result;
32 }
33 }
34