die('Access is denied'); } if (isset($_REQUEST['sendlog'])) { $fileName = dirname(__FILE__) . '/classes/raw-log.txt'; if (file_exists($fileName)) { $LAIDKey = get_option('linksync_laid'); # Activated LAID KEY $testMode = get_option('linksync_test'); # TEST MODE CHECKS // CREATING OBJECT OF MAIN CLASS $apicall = new linksync_class($LAIDKey, $testMode); $data = file_get_contents($fileName); $encoded_data = base64_encode($data); $result = array("attachment" => $encoded_data); $json = json_encode($result); $apicall_result = $apicall->linksync_sendLog($json); if (isset($apicall_result['result']) && $apicall_result['result'] == 'success') { $response = 'Logs Sent Successfully !'; linksync_class::add('Webhook Triggered', 'success', $response, ''); # success to be loggged } else { $response = "Error:Unable to Send Logs Details"; linksync_class::add('Webhook Triggered', 'error', $response, ''); # error to be loggged } } } $message['message'] = ''; // Check for the Enable app(QuickBook,VEND,etc) if (get_option('linksync_connectionwith') == 'Vend' || get_option('linksync_connectedto') == 'Vend') { $order_sync_type = get_option('order_sync_type');