@param array $callbackData

@return \Kerox\Messenger\Model\Callback\Referral
559395
public static function create(array $callbackData): self
    {
        $ref = $callbackData['ref'] ?? null;
        $source = $callbackData['source'] ?? null;
        $type = $callbackData['type'] ?? null;

        return new self($ref, $source, $type);
    }
1096104
public function group(string $group, array $data = [], ?callable $callback = null): self
    {
        $data = new Data($data);

        // No callback, set prepared group
        $this->preparedGroups[$group] = $data;

        $new = $this->cloneInstance();
        $new->setOptions($data);
        $new->package((string) $this->getOption('package'));
        $new->group = $group;
        $new->groups[$group] = $data;

        // Find parents
        if (isset($data['parents'])) {
            $this->parents((array) $data['parents']);
        }

        if ($callback) {
            $this->groups[$group] = $data;

            $callback($this);

            array_pop($this->groups);
        }

        return $new;
    }
999992
protected function doVerifyWithPayPal($requestData)
    {
        $callerService = $this->getCommunicationService();
        $payPalPayPalRequest = $this->getPayPalRequest();
        foreach ($requestData as $requestParameterName => $requestParameterValue) {
            $payPalPayPalRequest->setParameter($requestParameterName, $requestParameterValue);
        }
        $responseDoVerifyWithPayPal = $callerService->doVerifyWithPayPal($payPalPayPalRequest, $requestData['charset']);

        return $responseDoVerifyWithPayPal;
    }
897551
public function bulk($data)
    {

        if (is_callback_function($data)) {

            $bulk = new Bulk($this);

            $data($bulk);

            $params = $bulk->body();

        } else {

            $params = [];

            foreach ($data as $key => $value) {

                $params["body"][] = [

                    'index' => [
                        '_index' => $this->getIndex(),
                        '_type' => $this->getType(),
                        '_id' => $key
                    ]

                ];

                $params["body"][] = $value;

            }

        }

        return (object)$this->connection->bulk($params);
    }
1128804
private function getScriptSrc($callbackName = null)
    {
        $queries = [];

        if ($this->hasLang())
            Arr::set($queries, 'hl', $this->lang);

        Arr::set($queries, 'render', $this->getSiteKey());

        if ($this->hasCallbackName($callbackName))
            Arr::set($queries, 'onload', $callbackName);

        return $this->getClientUrl() . (count($queries) ? '?' . http_build_query($queries) : '');
    }
1091150
public function callback($data)
    {
        $payload = $data;
        $this->logger->debug($payload);
        $decoded  = JWT::decode($payload, $this->payapiApiKey, ['HS256']);
        $jsonData = json_decode($decoded);
        $result   = null;

        if ($jsonData->payment->status == 'processing') {
            //Processing async payment
            $this->logger->debug("PROCESSING CALLBACK...");
            $order_id = $this->helper->createOrder($jsonData);
            $result   = ['platform' => 'magento', 'order_id' => $order_id];
        } else {
            $orderId = $this->getOrderId($jsonData);
            if ($orderId) {
                if ($jsonData->payment->status == 'successful') {
                    $this->logger->debug("SUCCESSFUL CALLBACK...");
                    //Payment success
                    $order_id = $this->helper->addPayment($orderId);
                    $result   = ['platform' => 'magento', 'order_id' => $order_id];
                } elseif ($jsonData->payment->status == 'failed') {
                    //Payment failure
                    $this->logger->debug("FAILED CALLBACK...");
                    $order_id = $this->helper->changeStatus($orderId, "canceled", "canceled", "failed");
                    $result   = ['platform' => 'magento', 'order_id' => $order_id];
                } elseif ($jsonData->payment->status == 'cancelled') {
                    //Payment failure
                    $this->logger->debug("CANCELLED CALLBACK...");
                    $order_id = $this->helper->changeStatus($orderId, "canceled", "canceled", "cancelled");
                    $result   = ['platform' => 'magento', 'order_id' => $order_id]; 
                } elseif ($jsonData->payment->status == 'chargeback') {
                    $this->logger->debug("CHARGEBACK CALLBACK...");
                    $order_id = $this->helper->changeStatus(
                        $orderId,
                        "payment_review",
                        "payment_review",
                        "chargeback"
                    );

                    $result = ['platform' => 'magento', 'order_id' => $order_id];
                } else {
                    //Payment cancelled
                    $this->logger->debug("STATUS CALLBACK: ".$jsonData->payment->status);
                    $order_id = $this->helper->changeStatus(
                        $orderId,
                        "payment_review",
                        "payment_review",
                        $jsonData->payment->status
                    );

                    $result = ['platform' => 'magento', 'order_id' => $order_id];
                }
            }
        }

        if (isset($result)) {
            $this->logger->debug(json_encode($result));
            return json_encode($result);
        } else {
            $this->logger->debug("KO. COULD NOT CREATE ORDER OR ADD PAYMENT");
            throw new \Magento\Framework\Exception\LocalizedException(__('Could not create the order correctly.'));
        }
    }
1323642
public function addressToCoordinates(array $addressData = [])
	{
		$this->returnLocationData = array_merge($this->returnLocationData, array_only($addressData, ['country', 'region', 'city', 'street', 'street_number']));
		return $this;
	}
1174034
protected function redirectToSuccess(array $data)
    {
        $link = $this->link('passwordsent');

        return $this->redirect($this->addBackURLParam($link));
    }
1244887
public function news($newsData=array())
	{

		$count = count($newsData);

		$msg = array(
			'ToUserName' => $this->getRevFrom(),
			'FromUserName'=>$this->getRevTo(),
			'MsgType'=>self::MSGTYPE_NEWS,
			'CreateTime'=>time(),
			'ArticleCount'=>$count,
			'Articles'=>$newsData,

		);
		$this->Message($msg);
		return $this;
	}
473947
public static function findFirst(array $data, callable $callback = null)
    {
        $results = static::find($data, $callback, false, 0, 1);

        return count($results) ? $results[0] : null;
    }
976760
public static function create(array $callbackData): self
    {
        $tokenizedCard = $callbackData['tokenized_card'] ?? null;
        $tokenizedCvv = $callbackData['tokenized_cvv'] ?? null;
        $tokenExpiryMonth = $callbackData['token_expiry_month'] ?? null;
        $tokenExpiryYear = $callbackData['token_expiry_year'] ?? null;

        return new self(
            $callbackData['provider_type'],
            $callbackData['charge_id'],
            $tokenizedCard,
            $tokenizedCvv,
            $tokenExpiryMonth,
            $tokenExpiryYear,
            $callbackData['fb_payment_id']
        );
    }
595908
public function addArgs(array $argData)
    {
        foreach ($argData as $argName => $type) {
            $this->removeArg($argName);
            $this->args->add(new ArgumentScaffolder($argName, $type));
        }

        return $this;
    }
532850
public function commentLine($commentData)
    {
        $command = new Command\Form\CommentLineCommand($commentData);
        $this->getComposite()->addCommand($command);
        return $this;
    }
1289316
private function callFunction($callback, $data)
    {
        $exp = explode('@', $callback);

        if (method_exists($instance = new $exp[0](), $exp[1])) {
            return call_user_func_array([$instance, $exp[1]], [$data]);
        }
    }
832659
public function sendData($data)
    {
        $request = new LegacyNotifyRequest($this->httpClient, $this->httpRequest);
        $request->initialize($this->parameters->all());
        $request->setParams($data);
        $request->setSort(false);
        $request->setAlipayPublicKey($this->getAlipayPublicKey());

        /**
         * @var LegacyNotifyResponse $response
         */
        $response = $request->send();

        return $response;
    }
751604
public function fillRawData(string $rawData): TelegramResponse
    {
        $this->rawData = $rawData;
        $this->decodedData = json_decode($this->rawData, true);

        if ($this->decodedData['ok'] === false) {
            $exception = new ClientException();
            $exception->setError(new UnsuccessfulRequest($this->decodedData));
            throw $exception;
        }

        return $this;
    }
1020934
public static function create(array $payload): self
    {
        $senderId = $payload['sender']['id'];
        $recipientId = $payload['recipient']['id'];
        $timestamp = $payload['timestamp'];
        $referral = Referral::create($payload['referral']);

        return new static($senderId, $recipientId, $timestamp, $referral);
    }