public function validapi()
 {
     if (\Config::get('whmcs.useApiKey') == true) {
         $getkey = Helper::api_key();
         if ($getkey != 'null') {
             $cek = Helper::cek($getkey);
             if ($cek != 0) {
                 $result['result'] = 'success';
                 $result['message'] = 'Api key sudah terdaftar';
                 return json_encode($result);
             } else {
                 $result['result'] = 'error';
                 $result['message'] = 'Api key belum terdaftar';
                 return json_encode($result);
             }
         } else {
             $result['result'] = 'error';
             $result['message'] = 'Api key belum terdaftar';
             return json_encode($result);
         }
     }
 }
 /**
  * @link http://docs.whmcs.com/API:Order_Fraud_Check
  * @param pid - can be used to just retrieve the details of a specific product ID
  * @param gid - can be passed to just retrieve products in a specific group
  * @param module - can be passed to just retrieve products assigned to a specific module
  * @return json
  */
 public function getproducts()
 {
     if (\Config::get('whmcs.useApiKey') == true) {
         $getkey = Helper::api_key();
         if ($getkey != 'null') {
             $cek = Helper::cek($getkey);
             if ($cek != 0) {
                 $action = "getproducts";
                 $datas = WhmcsBase::init($action, Helper::get());
                 $result = json_encode($datas);
                 return $result;
             } else {
                 $result['result'] = 'error';
                 $result['message'] = 'Api key belum terdaftar';
                 return json_encode($result);
             }
         } else {
             $result['result'] = 'error';
             $result['message'] = 'Your API key is missing';
             return json_encode($result);
         }
     } else {
         $action = "getproducts";
         $datas = WhmcsBase::init($action, Helper::get());
         $result = json_encode($datas);
         return $result;
     }
 }