@param \Orkestra\Transactor\Entity\Account\SwipedCardAccount $account
@param string $rawTrackData Binary track data

@return void

@throws \Orkestra\Transactor\Exception\DecoderException
545861
public function decode(SwipedCardAccount $account, $rawTrackData)
    {
        $decoder = $this->getDecoderFor($rawTrackData);

        if (!$decoder) {
            throw new DecoderException('Unable to locate suitable decoder for the given track data');
        }

        $decoder->decode($account, $rawTrackData);
    }
128349
public function doBulkTrack()
    {
        if (empty($this->storedTrackingActions)) {
            throw new Exception(
                "Error:  you must call the function doTrackPageView or doTrackGoal from this class,
                 before calling this method doBulkTrack()"
            );
        }

        $data = array('requests' => $this->storedTrackingActions);

        // token_auth is not required by default, except if bulk_requests_require_authentication=1
        if (!empty($this->token_auth)) {
            $data['token_auth'] = $this->token_auth;
        }

        $postData = json_encode($data);
        $response = $this->sendRequest($this->getBaseUrl(), 'POST', $postData, $force = true);

        $this->storedTrackingActions = array();

        return $response;
    }
1351037
public function setAccount(AbstractAccount $account)
    {
        if ($this->isTransacted() || $this->parent) {
            return;
        }

        $this->account = $account;
    }
1258721
public function execute($formData = null)
    {
        $batch   = $this->getBatch();
        $import  = $batch->getVariable('import');
        $tracker = $this->loader->getTracker();

        $model = $tracker->getTrackModel();
        $model->applyFormatting(true, true);

        $trackData = $import['trackData'];
        $trackData['gtr_track_name'] = $formData['gtr_track_name'];
        $trackData['gtr_organizations'] = $formData['gtr_organizations'];

        // \MUtil_Echo::track($trackData);
        if ($trackData['gtr_date_start'] && (! $trackData['gtr_date_start'] instanceof \Zend_Date)) {
            $trackData['gtr_date_start'] = new \MUtil_Date($trackData['gtr_date_start'], 'yyyy-MM-dd');
        }
        $output = $model->save($trackData);

        $import['trackId'] = $output['gtr_id_track'];
        $import['trackData']['gtr_id_track'] = $output['gtr_id_track'];

        $batch->addMessage(sprintf($this->_('Created track with id %d'), $output['gtr_id_track']));
    }
280408
protected function buildMetadata($entity, $rawData = null)
    {
        $metadata = new ClassMetadata(get_class($entity));

        try {
            $template = $this->chooser->record($entity, $rawData);
            $template = $this->twig->resolveTemplate($template)->getSourceContext()->getName();
        } catch (LoaderError $e) {
            $template = null;
        }

        if ($template && isset($this->mapping['config'][$template])) {
            $mappings = $this->em->getMapper()->loadMetadataForFields($this->mapping['config'][$template]['fields']);
            $metadata->setFieldMappings((array) $mappings);
        }

        return $metadata;
    }
586055
public function execute( $query, $rawData = false ) {

    if ( strlen( $query ) > self::MAX_GET_SIZE ) {
      // big requests go to POST
      $this->method = 'POST';
    }

    $client = new Client();

    $response = $client->request( $this->method, self::SPARQL_ENDPOINT, [
        'query' => [ 
          "query" => $query, 
          "format" => "json",
          "maxQueryTimeMillis" => $this->timeout * 1000
        ]
    ]);

    $status = $response->getStatusCode();

    if ( $status != '200' ) {
      throw new Exception( 'HTTP Error' );
    }

    $result = $response->getBody();

    $data = json_decode( $result, true );
    
    if ( $data === null || $data === false ) {
      throw new Exception( "HTTP request failed, response:\n" .
        substr( $result, 1024 ) );
    }

    return $this->extractData( $data, $rawData );
  }
444202
public void setTraces(Trace... traces) {
        if (this.httpClient instanceof DefaultHttpClient) {
            ((DefaultHttpClient)this.httpClient).setTraces(traces);
        }
        else
            throw new UnsupportedOperationException("Invalid operation for class " + this.httpClient.getClass());
    }
1040406
public function processBeforeSave(array $fieldData, array $trackData)
    {
        $this->changed = false;

        if (! $this->exists) {
            return null;
        }

        foreach ($this->_fields as $key => $field) {
            if ($field instanceof FieldInterface) {
                $field->calculationStart($trackData);
            }
        }

        $output = array();

        foreach ($this->_fields as $key => $field) {
            if ($field instanceof FieldInterface) {
                $inVal  = isset($fieldData[$key]) ? $fieldData[$key] : null;
                $outVal = $field->calculateFieldValue($inVal, $fieldData, $trackData);

                if (is_array($outVal) || is_array($inVal)) {
                   if (is_array($outVal) && is_array($inVal)) {
                        $changedNow = ($outVal != $inVal);
                    } else {
                        $changedNow = true;
                    }
                } else {
                    $changedNow = ((string) $inVal !== (string) $outVal);
                }
                $this->changed = $this->changed || $changedNow;

                $fieldData[$key] = $outVal; // Make sure the new value is available to the next field
                $output[$key]    = $outVal;
            }
        }

        return $output;
    }
959236
public function calculationStart(array $trackData)
    {
        if (isset($trackData['gr2t_id_respondent_track'])) {
            $this->_lastActiveKey = $trackData['gr2t_id_respondent_track'];
        } elseif (isset($trackData['gr2t_id_user'], $trackData['gr2t_id_organization'])) {
            $this->_lastActiveKey = $trackData['gr2t_id_user'] . '__' . $trackData['gr2t_id_organization'];
        } else {
            $this->_lastActiveKey = false;
        }
        if ($this->_lastActiveKey) {
            self::$_lastActiveAppointment[$this->_lastActiveKey]    = null;
            self::$_lastActiveAppointmentIds[$this->_lastActiveKey] = array();
        }

        return $this;
    }
9812
void setAccount(String account)
    {
        final String oldAccount = this.account;

        this.account = account;
        firePropertyChange(PROPERTY_ACCOUNT, oldAccount, account);
    }
198146
protected function parseTransactionAccount()
    {
        $results = [];
        // SEPA MT940 Structured
        if (preg_match('/^:61:.*\n(.*?)(\n|\:8)/im', $this->getCurrentTransactionData(), $results)
            && !empty($results[1])
        ) {
            return $this->sanitizeAccount($results[1]);
        }

        if (preg_match('/^:61:.{26}(.{16})/m', $this->getCurrentTransactionData(), $results)
            && !empty($results[1])
        ) {
            return $this->sanitizeAccount($results[1]);
        }

        return '';
    }
826768
public static void encryptAsync(String raw, String password, RNCryptorNativeCallback RNCryptorNativeCallback) {
        byte[] encrypted;
        try {
            encrypted = new RNCryptorNative().encrypt(raw, password);
            RNCryptorNativeCallback.done(new String(encrypted, "UTF-8"), null);
        } catch (Exception e) {
            RNCryptorNativeCallback.done(null, e);
        }

    }
139949
public function decode(SwipedCardAccount $account, $rawTrackData)
    {
        $tracks = explode('?', $rawTrackData);

        $account->setTrackOne(isset($tracks[0])   ? $tracks[0] . '?' : null);
        $account->setTrackTwo(isset($tracks[1])   ? $tracks[1] . '?' : null);
        $account->setTrackThree(isset($tracks[2]) ? $tracks[2] . '?' : null);

        if (!empty($tracks[0])) {
            $parts = explode('^', $tracks[0]);
            $names = explode('/', $parts[1]);

            $account->setAccountNumber(substr($parts[0], 2));
            $account->setName(sprintf(
                '%s %s',
                ucfirst(strtolower(trim($names[1]))),
                ucfirst(strtolower(trim($names[0])))
            ));
            $this->trySetMonth($account, substr($parts[2], 2, 2));
            $this->trySetYear($account, '20' . substr($parts[2], 0, 2));

        } elseif (!empty($tracks[1])) {
            $parts = explode('=', $tracks[1]);

            $account->setAccountNumber(substr($parts[0], 1));
            $this->trySetMonth($account, substr($parts[1], 2, 2));
            $this->trySetYear($account, '20' . substr($parts[1], 0, 2));

        } elseif (!empty($tracks[2])) {
            $parts = explode('=', $tracks[2]);

            $account->setAccountNumber(substr($parts[0], 3));
            $this->trySetMonth($account, substr($parts[1], -3, 2));
            $this->trySetYear($account, '20' . substr($parts[1], -5, 2));
        }

        return $account;
    }
848256
protected function ensureRawDbDataArrayWellFormed($rawDataArray)
    {
        $isWellFormedSpecObj = $this->getIsRawDbDataArrayWellFormedSpecObj();

        if (!($isWellFormedSpecObj->isSatisfiedBy($rawDataArray))) {
            $mssg = 'Error - rawDataArray is not well formed';

            //for debugging
            //$mssg .= '<pre>'. print_r( $rawDataArray ) .'</pre>';

            foreach ($isWellFormedSpecObj->getMessages() as $specMssg) {
                $mssg .= ' - ' . $specMssg;
            }
            throw new Exception($mssg);
        }
    }
1203697
function(channel, accountInfo, fromNow, next) {
    var nowTime = helper.nowUTCSeconds(),
      trackingStruct = {
        owner_id : channel.owner_id,
        created : nowTime,
        last_poll : fromNow ? nowTime : 0,
        channel_id : channel.id
      };

    var model = this._dao.modelFactory('channel_pod_tracking', trackingStruct);
    this._dao.create(model, next, accountInfo);
  }
878839
static void writeTracker(JSONWriter writer, Tracker tracker)
			throws JSONException {
		writer.key("id");
		writer.value(tracker.getId());
		writer.key("name");
		writer.value(tracker.getName());
	}
853908
public function execute($respTrackData = null, $userId = null)
    {
        $batch     = $this->getBatch();
        $tracker   = $this->loader->getTracker();
        $respTrack = $tracker->getRespondentTrack($respTrackData);
        $engine    = $respTrack->getTrackEngine();

        $engine->checkRoundsFor($respTrack, $userId, $batch);
    }