예제 #1
0
 /**
  * подтверждение от Агента, что транзакция была обработана
  * по всем транзакциям, которые прежде были выгружены с этим guid
  *
  * @param string $guid
  */
 private function processAgentCommit($guid)
 {
     // флаг запуска именно этого процесса
     $doCommit = Input::get('SavePay', null);
     if (null === $doCommit) {
         return;
     }
     Log::debug('agent commit payment request process', ['guid' => $guid]);
     $qnt = PaymentCloud::whereGuid($guid)->count();
     Log::debug('search transactions for commit', ['qnt' => $qnt]);
     if (0 == $qnt) {
         Log::debug('response error', []);
         Response::json(['error' => 1])->send();
         die;
     }
     PaymentCloud::whereGuid($guid)->update(['exported' => 1, 'exported_at' => DB::raw('NOW()')]);
     $xml = new GenerateAgentXML();
     $xml->addEl('Error', 0);
     $xml->output();
     Log::debug('response commit xml', []);
     die;
 }