Create session token for guest

@param  array        $data
@return SessionToken
168029
public function createGuestSessionToken(array $data = [])
    {
        $token = new GuestSessionToken();

        if (array_key_exists('expires_at', $data)) {
            $token->setExpiresAt(new \DateTime($data['expires_at']));
        }

        if (array_key_exists('guest_session_id', $data)) {
            $token->setToken($data['guest_session_id']);
        }

        if (array_key_exists('success', $data)) {
            $token->setSuccess($data['success']);
        }

        return $token;
    }
843641
public static function createFromData(array $data): self
    {
        if (!isset($data['name'])) {
            throw new DomainException(self::REQUIRED_NAME);
        }

        switch ($data['name']) {
            case self::NAME_BLACKLIST:
                $action = new Actions\Blacklist($data);

                break;
            case self::NAME_CANCEL_SCHEDULED_PAYMENTS:
                $action = new Actions\CancelScheduledPayments($data);

                break;
            case self::NAME_GUESS_PAYMENT_CARD_EXPIRATION:
                $action = new Actions\GuessPaymentCardExpiration($data);

                break;
            case self::NAME_PICK_GATEWAY_ACCOUNT:
                $action = new Actions\PickGatewayAccount($data);

                break;
            case self::NAME_SCHEDULE_PAYMENT_RETRY:
                $action = new Actions\SchedulePaymentRetry($data);

                break;
            case self::NAME_SCHEDULE_PAYMENT:
                $action = new Actions\SchedulePayment($data);

                break;
            case self::NAME_SCHEDULE_INVOICE_RETRY:
                $action = new Actions\ScheduleInvoiceRetry($data);

                break;
            case self::NAME_SEND_EMAIL:
                $action = new Actions\SendEmail($data);

                break;
            case self::NAME_TRIGGER_WEBHOOK:
                $action = new Actions\TriggerWebhook($data);

                break;
            case self::NAME_STOP_SUBSCRIPTIONS:
                $action = new Actions\StopSubscriptions($data);

                break;
            case self::NAME_ADD_RISK_SCORE:
                $action = new Actions\AddRiskScore($data);

                break;
            case self::NAME_REQUEST_KYC:
                $action = new Actions\RequestKyc($data);

                break;
            case self::NAME_TAG_OR_UNTAG_CUSTOMER:
                $action = new Actions\TagOrUntagCustomer($data);

                break;
            default:
                throw new DomainException(
                    sprintf(self::UNEXPECTED_NAME, implode(', ', self::names()))
                );
        }

        return $action;
    }
481567
protected function createEvent(array &$data)
    {
        $event = new CustomerTitleEvent();

        if (isset($data["default"])) {
            $event->setDefault($data["default"]);
        }

        if (isset($data["title_id"])) {
            $event->setCustomerTitle(CustomerTitleQuery::create()->findPk($data["title_id"]));
        }

        if (isset($data["i18n"]) && !empty($data["i18n"])) {
            $row = array_shift($data["i18n"]);

            $this->hydrateEvent($row, $event);
        }

        return $event;
    }
1105230
public function createUser(array $data)
    {
        $result = $this->httpRaw(self::WECHAT_USER_CREATE_PREFIX, $data, [
            'access_token' => $this->getAccessToken()
        ]);
        return isset($result['errcode']) && !$result['errcode'];
    }
154425
public function create(array $data)
  {
    $AccountType = new AccountType();
    $AccountType->setConnection($this->databaseConnectionName);
    $AccountType->fill($data)->save();

    return $AccountType;
  }
1000521
protected function create(array $data)
    {
        $fields = [
            'name'     => $data['name'],
            'email'    => $data['email'],
            'password' => bcrypt($data['password']),
        ];
        if (config('auth.providers.users.field', 'email') === 'username' && isset($data['username'])) {
            $fields['username'] = $data['username'];
        }
        return User::create($fields);
    }
376727
public function requestAdccessToken($data)
    {
        $post = array(
            'client_id' => $this->_consumer->key,
            'client_secret' => $this->_consumer->secret,
            'code' => $data->code,
            'redirect_uri' => $this->_consumer->callback_url,
            'grant_type' => 'authorization_code',
        );
        $response = $this->getRequest(array('url' => $this->access_token_url, 'method' => AnHttpRequest::POST, 'data' => $post))->send();
        $result = $response->parseJSON();
        $this->setToken($result->access_token);

        return $result->access_token;
    }
349206
public function passMany(array $data)
    {
        if (!isset($this->_session))
            throw new \Exception('m\Http\Response: No session object available to flash "'.$key.'" to.');

        $this->_session->flashMany($data);

        return $this;
    }
1309067
public function createSignatureCredentials(array $data)
    {
        $credentials = new AsymmetricCredentials();
        $credentials->setMacId($data['access_token']);
        $credentials->setAlgorithm($data['mac_algorithm']);
        $credentials->setPrivateKey($data['mac_key']);
        $credentials->setPublicKey(isset($data['public_key']) ? $data['public_key'] : null);
        return $credentials;
    }
543015
public function sendData($data)
    {
        $token = $this->braintree->clientToken()->generate($data);

        return new ClientTokenResponse($this, $token);
    }
470995
public function create($data, $token = null)
    {
        if (isset($token)) {
            return $this->client()->put($data, 'password-tokens/{token}', ['token' => $token]);
        }

        return $this->client()->post($data, 'password-tokens');
    }
646519
public function create(array $data)
    {
        $response = $this->ontraport->post(
            $this->getNamespace(), $this->toArray($data)
        );

        return $this->ontraport->item($this, $response);
    }
760055
public function createUser(array $data) : User
    {
        $data['password'] = Hash::make($data['password']);
        return $this->create($data);
    }
896387
public function me(array $data = [])
    {
        $response = $this->request->get("me", $data);
        return new User($this->master, $response);
    }
1374610
public function createRequestToken(array $data = [])
    {
        $token = new RequestToken();

        if (array_key_exists('expires_at', $data)) {
            $token->setExpiresAt(new \DateTime($data['expires_at']));
        }

        if (array_key_exists('request_token', $data)) {
            $token->setToken($data['request_token']);
        }

        if (array_key_exists('success', $data)) {
            $token->setSuccess($data['success']);
        }

        return $token;
    }
1003981
public static function userAuthorize(array $data) {
		$_SESSION['numbers']['user'] = $data;
		// flag as authorized
		$_SESSION['numbers']['flag_authorized'] = true;
		// add authorized role
		$roles = \Object\ACL\Resources::getStatic('user_roles', 'authorized', 'data');
		self::roleGrant($roles);
	}
1073057
public function createUserToken(array $data)
    {
        $userToken = new TokenEntity;

        $expires = Arr::get($data, 'expires') ?: strtotime('+1 day', time());

        $defaults = [
            'created' => time(),
            'expires' => $expires,
            'token'   => $userToken->generateToken(),
        ];

        $userToken = $userToken->exchangeArray(array_merge($defaults, $data));

        return $this->tokenMapper->persist($userToken);
    }