Create method

@param  string   $token optional token for payment creation
@return Response
168713
public function create($token = null)
    {
        if ($token) {
            $this->model->setToken($token);
        }

        return $this->request->create($this->model);
    }
1270469
public static function create() {
        $token = Str::random(10);
		Factory::session()->set('_token', $token);
		Factory::response()->header->setCookie('XSRF-TOKEN', $token);
		Factory::view()->set('_token', $token);
		return $token;
	}
357473
public function create($token, $expireTime, $sessionId, $redirectUri)
    {
        $this->getConnection()->table('oauth_auth_codes')->insert([
            'id' => $token,
            'session_id' => $sessionId,
            'redirect_uri' => $redirectUri,
            'expire_time' => $expireTime,
            'created_at' => Carbon::now(),
            'updated_at' => Carbon::now(),
        ]);
    }
471009
public function tokenCreate($id, $token = null, $data = null){
		return $this->object->tokenCreate($id, $token, $data);
	}
1052728
public function setToken($token)
    {
        $this->tokenKey = $token->key;
        $this->tokenSecret = $token->secret;

        return $this;
    }
151487
private function create_token($token) {
        global $CFG;

        if (!$this->is_system_configured()) {
            return false;
        }

        require_once($CFG->libdir . '/filelib.php');

        $serverurl = $CFG->airnotifierurl . ':' . $CFG->airnotifierport . '/tokens/' . $token;
        $header = array('Accept: application/json', 'X-AN-APP-NAME: ' . $CFG->airnotifierappname,
            'X-AN-APP-KEY: ' . $CFG->airnotifieraccesskey);
        $curl = new curl;
        $curl->setHeader($header);
        $params = array();
        $resp = $curl->post($serverurl, $params);

        if ($token = json_decode($resp, true)) {
            if (!empty($token['status'])) {
                return $token['status'] == 'ok' || $token['status'] == 'token exists';
            }
        }
        debugging("Unexpected response from the Airnotifier server: $resp");
        return false;
    }
935328
protected function respondWithToken($token)
    {
        $tokenReponse = new \Stdclass;

        $tokenReponse->jwt = $token;
        $tokenReponse->token_type = 'bearer';
        $tokenReponse->expires_in = auth()->factory()->getTTL();

        return $this->response->item($tokenReponse, $this->getTransformer())->setStatusCode(200);
    }
492646
public function setAuthToken($token)
    {
        $this->apiClient
            ->setShopId(null)
            ->setShopPassword(null)
            ->setBearerToken($token);

        return $this;
    }
34776
public function create($payment, $paymentId = null)
    {
        if (isset($paymentId)) {
            return $this->client()->put($payment, 'payments/{paymentId}', ['paymentId' => $paymentId]);
        }

        return $this->client()->post($payment, 'payments');
    }
638279
public function create($token = null, array $options = [])
    {
        $customer = $this->getStripeCustomer($token, $options);
        $subscription = $customer->subscriptions->create($this->buildPayload());
        if ($this->skipTrial) {
            $trialEndsAt = null;
        } else {
            $trialEndsAt = $this->trialDays ? Carbon::now()->addDays($this->trialDays) : null;
        }
        $subscriptionModel = new SubscriptionModel([
            'user_id' => $this->user->id,
            'name' => $this->name,
            'stripe_id' => $subscription->id,
            'stripe_plan' => $this->plan,
            'quantity' => $this->quantity,
            'trial_ends_at' => $trialEndsAt,
            'ends_at' => null,
        ]);
        if ($subscriptionModel->save()) {
            return $subscriptionModel;
        } else {
            throw new Exception('Subscription was not saved.');
        }
    }
319418
public function createFromToken($token, $data, $cardId = null)
    {
        if ($data instanceof JsonSerializable) {
            $data = $data->jsonSerialize();
        }

        if (is_string($token)) {
            $data['token'] = $token;
        } else {
            $data['token'] = $token['token'];
        }

        return $this->create($data, $cardId);
    }
279017
public function createToken(string $tokenSalt): Token
    {
        $this->setToken(Token::create($this, $tokenSalt));
        return $this->token();
    }
226783
public function create($token, $expireTime, $accessToken)
    {
        $this->getConnection()->table('oauth_refresh_tokens')->insert([
            'id' => $token,
            'expire_time' => $expireTime,
            'access_token_id' => $accessToken,
            'created_at' => Carbon::now(),
            'updated_at' => Carbon::now(),
        ]);

        return (new RefreshTokenEntity($this->getServer()))
               ->setId($token)
               ->setAccessTokenId($accessToken)
               ->setExpireTime((int) $expireTime);
    }
981023
public function setToken($token)
    {
        $this->token = $token instanceof Token ? $token : new Token($token);

        return $this;
    }
1315000
public function create($token, $provider)
    {
        $provider = (new Provider)->forceFill([
            'oauth_access_token_id' => $token,
            'provider' => $provider,
            'created_at' => new Carbon(),
            'updated_at' => new Carbon(),
        ]);

        $provider->save();

        return $provider;
    }
669404
public function addToken(Token $token)
    {
        $response = $this
            ->httpClient
            ->get(
                sprintf('/%s/tokens', $this->getAppUUID()->getId()),
                'put',
                [],
                $token->toArray(),
                Http::getApisearchHeaders($this)
            );

        self::throwTransportableExceptionIfNeeded($response);
    }
1367950
public static function create(string $token, array $customHeaders = []): BunqResponseTokenQrRequestIdeal
    {
        $apiClient = new ApiClient(static::getApiContext());
        $responseRaw = $apiClient->post(
            vsprintf(
                self::ENDPOINT_URL_CREATE,
                [static::determineUserId()]
            ),
            [self::FIELD_TOKEN => $token],
            $customHeaders
        );

        return BunqResponseTokenQrRequestIdeal::castFromBunqResponse(
            static::fromJson($responseRaw, self::OBJECT_TYPE_POST)
        );
    }