\brief Send an update once the user has confirmed their payment.
@param bool $ok True is everything is alright, elsewhere False.
@param string $error The error message if something went wrong.
@return bool True on success.
504170
public function answerPreCheckoutQuery(bool $ok = true, string $error = null) {
        if (!isset($this->_pre_checkout_query_id)) {
            throw new BotException('Callback query ID not set, wrong update');
        }

        $parameters = [
            'pre_checkout_query_id' => $this->_pre_checkout_query_id,
            'ok' => $ok,
            'error_message' => $error
        ];

        return $this->execRequest('answerPreCheckoutQuery?' . http_build_query($parameters));
    }
460870
public function confirm($question, $yesScript, $noScript)
    {
        return $this->getConfirmLibrary(true)->confirm($question, $yesScript, $noScript);
    }
631801
protected function checkValue(&$errors = [])
    {
        if ($this->getRequired() && !array_key_exists($this->getName(), $_FILES)) {
            $errors[] = $this->getLabel() . ' is required.';
            $this->error = $this->getLabel() . ' is required.';
            return false;
        }

        return true;
    }
485974
public function confirm($text = 'Do you wish to continue?')
    {
        $this->output->writeln($text);

        return $this->convertToBool($this->input->getInput());
    }
1211952
public function checkForUpdates($quick = false)
    {

        if (!$this->subModuleUpdater) {
            $this->site->getVariables()->setValue("last_checked", time());
        }
        if ($this->canBeUpdated === null) {
            $this->canBeUpdated = $this->site->getVariables()->getValue("can_be_updated") == 1;
        }
        if ($this->canBeUpdated) {
            return true;
        }

        if($quick){
            return false;
        }

        $this->exec("git fetch");

        $updateAvailable = ($this->getRevision('HEAD') != $this->getRevision("origin/" . $this->currentBranch()) || array_reduce($this->subUpdaters, function ($result, Updater $input) {
                return $result || $input->checkForUpdates();
            }, false));
        if ($this->canBeUpdated != $updateAvailable) {
            $this->site->getVariables()->setValue("can_be_updated", $updateAvailable ? 1 : 0);
        }

        return $this->canBeUpdated = $updateAvailable;
    }
616521
public function slaveOkay($ok = true)
    {
        $ok = (boolean) $ok;
        $this->slaveOkay = $ok;
        $this->setMongoCursorSlaveOkay($ok);
        return $this;
    }
337991
public function setBusy($bool = true)
    {
        $this->busyCounter = 0;
        $this->isBusy = (bool)$bool;
        if ($bool) {
            $text = "Please wait...";
            if (is_string($bool)) {
                $text = (string)$bool;
            }
            $lbl = Label::create();
            $lbl->setText($text)->setTextColor("fff")->setTextSize(6)
                ->setSize(90, 12)->setAlign("center", "center")
                ->setPosition($this->busyFrame->getWidth() / 2, -($this->busyFrame->getHeight() / 2));

            $this->busyFrame->addChild($lbl);
            $quad = Quad::create();
            $quad->setStyles("Bgs1", "BgDialogBlur");
            $quad->setBackgroundColor("f00")->setSize($this->busyFrame->getWidth(), $this->busyFrame->getHeight());
            $this->busyFrame->addChild($quad);
        } else {
            $this->busyFrame->removeAllChildren();
        }
    }
1109685
public function when($value, $true_call, $false_call = null)
    {
        if ($value) {
            $true_call($this, $value);
        } elseif ($false_call) {
            $false_call($this, $value);
        }

        return $this;
    }
219379
function validate($value, $key, $fields, $options, $exists, \CharlotteDunois\Validation\Validator $validator) {
        if(!$exists) {
            return false;
        }
        
        if(empty($options)) {
            $options = 'confirmation';
        }
        
        if(!isset($fields[$key.'_'.$options]) || $fields[$key] !== $fields[$key.'_'.$options]) {
            return 'formvalidator_make_confirmed';
        }
        
        return true;
    }
449577
public function confirm(string $prompt, bool $yes = null): bool
    {
        $default = null;
        if ($yes === true) {
            $default = 'Y';
        } elseif ($yes === false) {
            $default = 'n';
        }

        return 'Y' === $this->ask($prompt, ['Y', 'n'], $default);
    }
431574
protected function isSuccess($response, $code)
    {
        if ($code !== 200 && $code !== 201) {
            return false;
        }

        if (isset($response['error'])) {
            return false;
        }

        if (!empty(Arr::get($response, 'payments'))) {
            return in_array($this->getPaymentStatus($response), $this->successPaymentStatuses);
        }

        return true;
    }
622523
public function isInvalid(?array &$errors = null): bool
	{
		[$isValid, $errors] = $this->process();

		return $isValid === false;
	}
192781
protected function checkScope($update = true)
    {
        $request = request();

        if ($update && $request->exists('scope')) {

            $this->activeScope = $request->get('scope');

            $this->markResetActivePage();
            $this->storeActiveScopeInSession();
        } else {
            $this->retrieveActiveScopeFromSession();
        }

        // Check if active is valid, reset it othwerwise
        if ($this->activeScope && ! $this->isValidScopeKey($this->activeScope)) {
            $this->activeScope = null;
            $this->storeActiveScopeInSession();
        }

        return $this;
    }
928984
private function hasValue(array $check, string $value): bool
    {
        if (empty($check[$value])) {
            return false;
        }

        return true;
    }
304295
public function allowCredentials($bool = true)
    {
        $this->response = $this->corsHandler->setResponse($this->response)
            ->allowCredentials($bool)
            ->getResponse();

        return $this;
    }
22306
public function raw($text, bool $error = false): self
    {
        return $this->doWrite((string) $text, $error);
    }
879196
final protected function validateBool($value, array $allowed) : bool
    {
        if (true === in_array('bool', $allowed)) {
            if (true === is_bool($value)) {
                return true;
            }
        }

        return false;
    }