private function processAgentExport($guid)
 {
     // флаг запуска именно этого процесса
     $doExport = Input::get('Load', null);
     if (null === $doExport) {
         return;
     }
     Log::debug('agent export request process', ['guid' => $guid]);
     // все оплаченные не выгруженные заказы
     $list = PaymentCloud::payed()->notExported()->notFailed()->get()->all();
     Log::debug('search transactions for export', ['qnt' => count($list)]);
     if (0 == count($list)) {
         Log::debug('response error', []);
         Response::json(['error' => 1])->send();
         die;
     }
     $xml = new GenerateAgentXML();
     foreach ($list as $pay) {
         $a = $xml->addEl('Pay');
         $pan = $pay->card_pan ? substr($pay->card_pan, -4) : '0000';
         $type = $pay->card_type ? $pay->card_type : 'YandexWallet';
         $xml->addEl('mysql_id', $pay->id, $a);
         $xml->addEl('dor_id', $pay->order_id, $a);
         $xml->addEl('contr_id', $pay->customer_id, $a);
         $xml->addEl('amount', $pay->amount, $a);
         $xml->addEl('token', $pay->token, $a);
         $xml->addEl('card_last_four', $pan, $a);
         $xml->addEl('card_type', $type, $a);
         $xml->addEl('pay_system_id', $pay->getPaySystemId(), $a);
         $pay->guid = $guid;
         $pay->save();
         Log::debug('set guid into payment transaction', ['id' => $pay->id]);
     }
     $xml->output();
     Log::debug('response export xml', []);
     die;
 }