@param Model $pointable
@param $amount
@param $message
@param $data

@return static
352041
public function addTransaction(Model $pointable, $amount, $message, $data = null)
    {
        $transaction = new static();
        $transaction->amount = $amount;

        $transaction->current = $this->getCurrentPoints($pointable) + $amount;

        $transaction->message = $message;
        if ($data) {
          $transaction->fill($data);
        }
        // $transaction->save();
        $pointable->transactions()->save($transaction);

        return $transaction;
    }
718837
public function send(
        array $data,
        MembershipInterface $sender,
        MembershipInterface $receiver,
        MessageParticipantModelInterface $replyTo = null // TODO: Check if this should be Message instead
    ): PodiumResponse
    {
        $sending = $this->getMessenger();

        $sending->setSender($sender);
        $sending->setReceiver($receiver);
        $sending->setReplyTo($replyTo);

        if (!$sending->loadData($data)) {
            return PodiumResponse::error();
        }

        return $sending->send();
    }
1256633
public static function throwException($message, $messageStorage = null)
    {
        if ($messageStorage && ($storage = Mage::getSingleton($messageStorage))) {
            $storage->addError($message);
        }

        $exception = new Adyen_Payment_Exception($message);
        self::logException($exception);

        throw $exception;
    }
415392
static public function count($countable, $count, $message = null, $propertyPath = null)
        {
            if ($count !== count($countable)) {
                $message = $message ?: sprintf(
                    'List does not contain exactly "%d" elements.',
                    static::stringify($countable),
                    static::stringify($count)
                );

                throw static::createException($countable, $message, static::INVALID_COUNT, $propertyPath, array('count' => $count));
            }
        }
1083549
public static function create(array $data = [], array $rules = [], array $messages = [])
    {
        $model = new static;
        $model->saveRecursive($data, $rules, $messages);

        return $model;
    }
197306
public static function output($message, $data = null)
    {
        if (static::$mode == "html") {
            static::html($message, $data);
        } else {
            static::text($message, $data);
        }
    }
127594
public static function html($message, $data = null)
    {
        if (!static::$on) {
            return;
        }

        echo "<hr>";
        echo "<i>";
            static::indent();
            echo "<b>" . static::getTime() . " - " . $message . "</b>";
            if (is_array($data)) {
                Html::print_r($data);
            } elseif ($data) {
                static::indent();
                echo "&nbsp;&nbsp;&nbsp;&nbsp;" . $data . "<br>";
            }
        echo "</i>";
    }
1363454
public function log(
        $level,
        $message,
        $paymentMethod,
        array $context = []
    ) {
        if (!$this->active) {
            return $this;
        }

        $this
            ->logger
            ->log(
                $level,
                "[$paymentMethod] - $message",
                $context
            );

        return $this;
    }
177561
public static function text($message, $data = null)
    {
        if (!static::$on) {
            return;
        }

        echo "--------------------------------------------------------------------------------\n";
        static::indent();
        echo static::getTime() . " - " . $message . "\n";
        if (is_array($data)) {
            print_r($data);
        } elseif ($data) {
            static::indent();
            echo "    " . $data . "\n";
        }
    }
19159
static public function fromMicro($amount, $divisibility = 6)
    {
        $amt = new Amount(["amount" => $amount]);
        $amt->setDivisibility($divisibility);

        return $amt;
    }
401206
public function decodeMessage($message, $data)
    {
        // Get message descriptor
        $pool = DescriptorPool::getGeneratedPool();
        $messageType = $pool->getDescriptorByClassName(get_class($message));
        try {
            return $this->decodeMessageImpl($message, $messageType, $data);
        } catch (\Exception $e) {
            throw new ValidationException(
                "Error decoding message: " . $e->getMessage(),
                $e->getCode(),
                $e
            );
        }
    }
962208
public function btc($address, $amount, $label, $message, $returnAddress) {
        return $this->encode(sprintf('bitcoin:%s?%s', $address, http_build_query([
            'amount'    => $amount,
            'label'     => $label,
            '$message'  => $message,
            'r'         => $returnAddress,
        ])));
    }
588729
function message ($phone_number, $message, $message_type, array $other = []) {
    return $this->post(self::MESSAGING_RESOURCE, array_merge($other, [
      "phone_number" => $phone_number,
      "message" => $message,
      "message_type" => $message_type
    ]));
  }
567134
public function info($message, array $placeholders = [], $dismissible = true)
    {
        $this->message($message, null, $placeholders, 'info', $dismissible);

        return $this;
    }
875260
public function create(array $data, MembershipInterface $author, ModelInterface $thread): PodiumResponse
    {
        /* @var $postForm CategorisedFormInterface */
        $postForm = $this->getForm();

        $postForm->setAuthor($author);
        $postForm->setThread($thread);

        if (!$postForm->loadData($data)) {
            return PodiumResponse::error();
        }

        return $postForm->create();
    }
1321950
public function push($amount = null, $number = null, $reference = null, $command = null, $account = null)
    {
        $account = $account ?: $this->account;
        $configs = (new ConfigurationRepository)->useAccount($account);

        if (!$configs->getAccountKey('sandbox')) {
            throw new ErrorException('Cannot simulate a transaction in the live environment.');
        }

        $shortCode = $configs->getAccountKey('lnmo.shortcode');

        $body = [
            'CommandID'     => $command ?: $this->command,
            'Amount'        => $amount ?: $this->amount,
            'Msisdn'        => $number ?: $this->number,
            'ShortCode'     => $shortCode,
            'BillRefNumber' => $reference ?: $this->reference,
        ];

        try {
            $response = $this->makeRequest(
                $body,
                Core::instance()->getEndpoint(MPESA_SIMULATE, $account),
                $account
            );

            return json_decode($response->getBody());
        } catch (RequestException $exception) {
            return json_decode($exception->getResponse()->getBody());
        }
    }
158370
protected function fill(MailableContract $mailable)
    {
        return $mailable->to($this->to)
                        ->cc($this->cc)
                        ->bcc($this->bcc)
                        ->locale($this->locale);
    }