Prepare the STK Push request

@param int    $amount
@param int    $number
@param string $reference
@param string $description
@param string $account

@return mixed
2283
public function push($amount = null, $number = null, $reference = null, $description = null, $account = null)
    {
        $account = $account ?: $this->account;
        $time = Carbon::now()->format('YmdHis');
        $configs = (new ConfigurationRepository)->useAccount($account);

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

        $body = [
            'BusinessShortCode' => $shortCode,
            'Password'          => $this->getPassword($shortCode, $passkey, $time),
            'Timestamp'         => $time,
            'TransactionType'   => 'CustomerPayBillOnline',
            'Amount'            => $amount ?: $this->amount,
            'PartyA'            => $number ?: $this->number,
            'PartyB'            => $shortCode,
            'PhoneNumber'       => $number ?: $this->number,
            'CallBackURL'       => $callback,
            'AccountReference'  => $reference ?: $this->reference,
            'TransactionDesc'   => $description ?: $this->description,
        ];

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

            return json_decode($response->getBody());
        } catch (RequestException $exception) {
            return json_decode($exception->getResponse()->getBody());
        }
    }
264329
public function invoiceFor($description, $amount, array $options = []): Successful
    {
        return $this->tab($description, $amount, $options);
    }
871003
public function tab($description, $amount, array $options = [])
    {
        if (! $this->stripe_id) {
            throw new InvalidArgumentException(class_basename($this).' is not a Stripe customer. See the createAsStripeCustomer method.');
        }

        $options = array_merge([
            'customer' => $this->stripe_id,
            'amount' => $amount,
            'currency' => $this->preferredCurrency(),
            'description' => $description,
        ], $options);

        return StripeInvoiceItem::create($options, ['api_key' => $this->getStripeKey()]);
    }
243094
public function addImmediateIncomingPaymentRequest(string $payerNr, SEK $amount, string $ref): void
    {
        $this->addImmediatePaymentRequest('IncomingPaymentRequest', $payerNr, $amount, $ref);
    }
1233907
public function request($callbackURL, $Amount, $Description, $Email = null, $Mobile = null, $additionalData = null)
    {
        $inputs = [
            'MerchantID'  => $this->merchantID,
            'CallbackURL' => $callbackURL,
            'Amount'      => $Amount,
            'Description' => $Description,
        ];
        if (!is_null($Email)) {
            $inputs['Email'] = $Email;
        }
        if (!is_null($Mobile)) {
            $inputs['Mobile'] = $Mobile;
        }
        if (!is_null($additionalData)) {
            $inputs['AdditionalData'] = $additionalData;
            $results = $this->driver->requestWithExtra($inputs);
        } else {
            $results = $this->driver->request($inputs);
        }

        if (empty($results['Authority'])) {
            $results['Authority'] = null;
        }
        $this->Authority = $results['Authority'];

        return $results;
    }
473193
public function createPlan($name, $description, $amount, $currency)
    {
        return $this->getPlanModel()->make($name, $description, $amount, $currency)->save();
    }
249609
public function authorize($amount = null)
    {
        return (new AuthorizationBuilder(TransactionType::AUTH, $this))
                        ->withAmount($amount)
                        ->withOneTimePayment(true);
    }
865528
private function transaction($command, $amount, $currency = 981, $description = '', $language = 'GE', $type = 'SMS', array $additional = [])
    {
        return $this->process(
            $command,
            array_merge([
                'amount'         => $amount,
                'currency'       => $currency,
                'client_ip_addr' => $this->clientIp,
                'description'    => $description,
                'language'       => $language,
                'msg_type'       => $type,
            ], $additional)
        );
    }
703227
public static function formatAmount($amount)
    {
        if (static::$formatCurrencyUsing) {
            return call_user_func(static::$formatCurrencyUsing, $amount);
        }

        $amount = number_format($amount / 100, 2);

        if (Str::startsWith($amount, '-')) {
            return '-'.static::usesCurrencySymbol().ltrim($amount, '-');
        }

        return static::usesCurrencySymbol().$amount;
    }
1308437
public function authorize($amount = null)
    {
        if (is_null($amount)) {
            $amount = $this->getAmount()->total;
        }
        $path = sprintf('/%s/%s?payment_id=%s&amount=%s', self::SIMULATOR_PATH, 'authorize', $this->getId(), $amount);
        $response = $this->httpRequest($path, Requests::GET);

        if (empty($response)) {
            return true;
        }

        return false;
    }
1043568
public static function qrPaymentImage($account, $amount, $variableSymbol, $message = 'QR Platba', $size = 200)
    {
        $account = explode('/', $account);
        $url = 'http://api.paylibo.com/paylibo/generator/czech/image?'
            .'accountNumber='.str_replace([' ', '-'], '', $account[0])
            .'&bankCode='.$account[1]
            .'&amount='.number_format($amount, 2, '.', '')
            .'&message='.urlencode($message)
            .'&size='.$size
            .'&currency=CZK'
            .'&vs='.$variableSymbol;

        return $url;
    }
672637
public function recurPayment(
        $iSourceOrderNumber,
        $iAmount,
        $sCurrency,
        $sOrderDescription,
        $iOrderNumber = null,
        $bDepositFlag = null
    ) {
        $this->_requestData[self::COMMAND] = self::$COMMAND_RECUR_PAYMENT;

        $this->_setField(self::SOURCE_ORDER_NUMBER, $iSourceOrderNumber);
        $this->_setField(self::AMOUNT, $iAmount);
        $this->_setField(self::CURRENCY, strtoupper($sCurrency));

        $this->_setField(self::ORDER_DESCRIPTION, $sOrderDescription);

        if (!is_null($iOrderNumber)) {
            $this->_setField(self::ORDER_NUMBER, $iOrderNumber);
        }

        if (!is_null($bDepositFlag)) {
            $this->_setField(self::AUTO_DEPOSIT, $bDepositFlag ? self::$BOOL_TRUE : self::$BOOL_FALSE);
        }


        $this->_fingerprintOrder->setOrder(Array(
            self::CUSTOMER_ID,
            self::SHOP_ID,
            self::TOOLKIT_PASSWORD,
            self::SECRET,
            self::COMMAND,
            self::LANGUAGE,
            self::ORDER_NUMBER,
            self::SOURCE_ORDER_NUMBER,
            self::AUTO_DEPOSIT,
            self::ORDER_DESCRIPTION,
            self::AMOUNT,
            self::CURRENCY
        ));

        return new WirecardCEE_QPay_Response_Toolkit_RecurPayment($this->_send());
    }
368360
public static function formatAmount(int $amount): string
    {
        if (static::$formatCurrencyUsing) {
            return call_user_func(static::$formatCurrencyUsing, $amount);
        }
        $amount = number_format($amount / 100, 2);
        if (StringHelper::startsWith($amount, '-')) {
            return '-' . static::usesCurrencySymbol() . ltrim($amount, '-');
        }

        return static::usesCurrencySymbol() . $amount;
    }
1213176
private function addInvoice($order_id, $money = null)
    {
        $this->post['reference'] = $order_id;

        if ($money) {
            $this->post['amount'] = $this->amount($money);
        }

    }
1247221
public function doReferenceTransaction($transaction, $action, $amount = 0.00)
    {
        $this->setRequestData([
            'REFERENCEID'   => $transaction,
            'PAYMENTACTION' => $action,
            'AMT'           => $amount,
        ]);

        return $this->doPayPalRequest('DoReferenceTransaction');
    }
1061504
public function authorize($amount = null)
    {
        $builder = new HpsCreditServiceAuthorizeBuilder($this);
        return $builder
            ->withAmount($amount)
            ->withCurrency('usd');
    }
170312
function initCompleteTransaction($amount, $buyOrder, $sessionId, $cardExpirationDate, $cvv, $cardNumber) {

        try {

            $wsCompleteInitTransactionInput = new wsCompleteInitTransactionInput();
            $completeCardDetail = new completeCardDetail();
            $wsCompleteTransactionDetail = new wsCompleteTransactionDetail();

            /** (Obligatorio) Indica el tipo de transacción, su valor debe ser siempre TR_COMPLETA_WS */
            $wsCompleteInitTransactionInput->transactionType = 'TR_COMPLETA_WS';
            $wsCompleteInitTransactionInput->sessionId = $sessionId;

            $wsCompleteTransactionDetail->amount = $amount;
            $wsCompleteTransactionDetail->buyOrder = $buyOrder;
            $wsCompleteTransactionDetail->commerceCode = $this->config->getCommerceCode();

            $completeCardDetail->cardExpirationDate = $cardExpirationDate;
            $completeCardDetail->cvv = $cvv;
            $completeCardDetail->cardNumber = $cardNumber;

            /** (Obligatorio) Objeto del tipo wsTransactionDetail que contiene información asociada a la tarjeta de crédito */
            $wsCompleteInitTransactionInput->cardDetail = $completeCardDetail; // cardDetails

            /** (Obligatorio) Lista de objetos del tipo wsTransactionDetail, el cual contiene datos de la transacción. Máxima cantidad de repeticiones es de 1 para este tipo de transacción */
            $wsCompleteInitTransactionInput->transactionDetails = $wsCompleteTransactionDetail; // wsTransactionDetail

            $initCompleteTransactionResponse = $this->_initCompleteTransaction(
                    array("wsCompleteInitTransactionInput" => $wsCompleteInitTransactionInput)
            );

            $xmlResponse = $this->soapClient->__getLastResponse();
            $soapValidation = new SoapValidation($xmlResponse, $this->config->getWebpayCert());
            $validationResult = $soapValidation->getValidationResult();

            if ($validationResult === TRUE) {

                $wsCompleteInitTransactionOutput = $initCompleteTransactionResponse->return;
                return $wsCompleteInitTransactionOutput;
            } else {

                $error["error"] = "Error validando conexi&oacute;n a Webpay (Verificar que la informaci&oacute;n del certificado sea correcta)";
                $error["detail"] = "No se pudo completar la conexi&oacute;n con Webpay";
            }
        } catch (Exception $e) {

            $error["error"] = "Error conectando a Webpay (Verificar que la informaci&oacute;n del certificado sea correcta)";

            $replaceArray = array('<!--' => '', '-->' => '');
            $error["detail"] = str_replace(array_keys($replaceArray), array_values($replaceArray), $e->getMessage());
        }

        return $error;
    }