@@ -36,88 +36,6 @@ public function authentication($fieldsRequestParams)
3636 wp_send_json_success (__ ('Authentication successful ' , 'bit-integrations ' ), 200 );
3737 }
3838
39- // public function getAllCustomer($fieldsRequestParams)
40- // {
41- // $this->checkValidation($fieldsRequestParams);
42- // $this->setHeaders($fieldsRequestParams->api_key, $fieldsRequestParams->api_secret);
43-
44- // $customers = get_users(['role' => 'customer', 'number' => -1]);
45-
46- // wp_send_json_success(array_map(function ($customer) {
47- // return ['id' => $customer->ID, 'name' => $customer->display_name];
48- // }, $customers), 200);
49- // }
50-
51- // public function getAllProduct($fieldsRequestParams)
52- // {
53- // if (!class_exists('WooCommerce')) {
54- // wp_send_json_success([], 200);
55- // }
56-
57- // $this->checkValidation($fieldsRequestParams);
58- // $this->setHeaders($fieldsRequestParams->api_key, $fieldsRequestParams->api_secret);
59-
60- // $products = wc_get_products(['status' => 'publish', 'limit' => -1]);
61-
62- // wp_send_json_success(array_map(function ($product) {
63- // return ['id' => $product->get_id(), 'name' => $product->get_title()];
64- // }, $products), 200);
65- // }
66-
67- // public function getAllOrder($fieldsRequestParams)
68- // {
69- // if (!class_exists('WooCommerce')) {
70- // wp_send_json_success([], 200);
71- // }
72-
73- // $this->checkValidation($fieldsRequestParams);
74- // $this->setHeaders($fieldsRequestParams->api_key, $fieldsRequestParams->api_secret);
75-
76- // $orders = wc_get_orders(['limit' => -1, 'orderby' => 'date', 'order' => 'DESC']);
77-
78- // wp_send_json_success(array_map(function ($order) {
79- // return ['id' => $order->get_id(), 'name' => '#' . $order->get_id() . ' Order'];
80- // }, $orders), 200);
81- // }
82-
83- // public function getAllLicense($fieldsRequestParams)
84- // {
85- // $this->checkValidation($fieldsRequestParams);
86- // $this->setHeaders($fieldsRequestParams->api_key, $fieldsRequestParams->api_secret);
87-
88- // $apiEndpoint = $fieldsRequestParams->base_url . '/wp-json/acpt/v2/licenses';
89- // $response = HttpHelper::get($apiEndpoint, null, $this->_defaultHeader, ['sslverify' => false]);
90-
91- // if (is_wp_error($response)) {
92- // wp_send_json_error($response->get_error_message(), HttpHelper::$responseCode);
93- // }
94- // if (isset($response->success) && $response->success) {
95- // wp_send_json_success(array_column($response->data, 'licenseKey'), 200);
96- // }
97-
98- // wp_send_json_error(!empty($response->message) ? $response->message : wp_json_encode($response), 400);
99- // }
100-
101- // public function getAllGenerator($fieldsRequestParams)
102- // {
103- // $this->checkValidation($fieldsRequestParams);
104- // $this->setHeaders($fieldsRequestParams->api_key, $fieldsRequestParams->api_secret);
105-
106- // $apiEndpoint = $fieldsRequestParams->base_url . '/wp-json/acpt/v2/generators';
107- // $response = HttpHelper::get($apiEndpoint, null, $this->_defaultHeader, ['sslverify' => false]);
108-
109- // if (is_wp_error($response)) {
110- // wp_send_json_error($response->get_error_message(), HttpHelper::$responseCode);
111- // }
112- // if (isset($response->success) && $response->success) {
113- // wp_send_json_success(array_map(function ($generator) {
114- // return ['id' => $generator->id, 'name' => $generator->name];
115- // }, $response->data), 200);
116- // }
117-
118- // wp_send_json_error(!empty($response->message) ? $response->message : wp_json_encode($response), 400);
119- // }
120-
12139 public function execute ($ integrationData , $ fieldValues )
12240 {
12341 $ integrationDetails = $ integrationData ->flow_details ;
0 commit comments