Initiate the transaction and send the information to IPay.

@return string
547253
private function initiateTransaction()
    {
        $params = [
            "live" => $this->isLive,
            "oid" => $this->transaction['orderId'],
            "inv" => $this->transaction['invoiceNumber'] ?: $this->transaction['orderId'],
            "ttl" => $this->transaction['amount'],
            "tel" => $this->customer['telephoneNumber'],
            "eml" => $this->customer['email'],
            "vid" => $this->vendorId,
            "curr" => $this->currency,
            "p1" => $this->payloads['payload1'],
            "p2" => $this->payloads['payload2'],
            "p3" => $this->payloads['payload3'],
            "p4" => $this->payloads['payload4'],
            "lbk" => $this->failedCallback,
            "cbk" => $this->callback,
            "cst" => $this->customer['sendEmail'],
            "crl" => $this->callbackMode,
            "hsh" => $this->generateInitialHash(),
        ];


        foreach ($this->allChannels as $channel) {
            if (in_array($channel, $this->activeChannels)) {
                $params[$channel] = 1;
                continue;
            }

            $params[$channel] = 0;
        }

        try {
            $response = $this->client->request('POST', $this->initiateEndpoint, [
                'form_params' => $params
            ]);

            return $response->getBody()->getContents();
        } catch (\Exception $exception) {
            return $exception->getMessage();
        }
    }
920422
public final function beginTransaction()
    {
        //łączenie jeśli niepołączony
        if (!$this->_connected) {
            $this->connect();
        }
        //rozpoczęcie transakcji
        $this->_transactionInProgress = true;
        return $this->_upstreamPdo->beginTransaction();
    }
22275
protected function addTransaction()
    {
        /* @var $model \gplcart\core\models\Transaction */
        $model = gplcart_instance_model('Transaction');

        $transaction = array(
            'total' => $this->data_order['total'],
            'order_id' => $this->data_order['order_id'],
            'currency' => $this->data_order['currency'],
            'payment_method' => $this->data_order['payment'],
            'gateway_transaction_id' => $this->response->getTransactionReference()
        );

        return $model->add($transaction);
    }
156162
public function startTransaction()
    {

        if (!is_a($this->resourceId, "mysqli")) {
            throw new QueryException("No valid db resource Id found. This is required to start a transaction");
            return false;
        }
        $this->resourceId->autocommit(FALSE); //Turns autocommit off;

    }
311231
public function createPaymentRequest()
    {
        try {
            $this->currency();
            $this->reference();
            $this->discounts();
            $this->shipping();
            $this->sender();
            $this->urls();
            $this->items();
            $this->config();
            $this->setShoppingCartRecovery();
            return $this->register();
        } catch (\Exception $exception) {
            throw $exception;
        }
    }
608472
protected function begin_transaction() {
        // Recordsets do not work well with transactions in SQL Server,
        // let's prefetch the recordsets to memory to work around these problems.
        foreach ($this->recordsets as $rs) {
            $rs->transaction_starts();
        }

        $this->query_start('native sqlsrv_begin_transaction', NULL, SQL_QUERY_AUX);
        $result = sqlsrv_begin_transaction($this->sqlsrv);
        $this->query_end($result);
    }
1182467
public function beginTransaction() {
        $this->_fireEvent('phpsweetpdo.begin_transaction.started', array ());
        $result = $this->_pdoObject->beginTransaction();
        $this->_fireEvent('phpsweetpdo.begin_transaction.finished', array ('result' => $result));

        return $result;
    }
1343624
public function request()
    {
        //load payments by date
        $this->getPagSeguroAbandoned();

        if ($this->_PagSeguroPaymentList->getTransactions()) {
            foreach ($this->_PagSeguroPaymentList->getTransactions() as $payment) {
                date_default_timezone_set('UTC');
                $order = \UOL\PagSeguro\Helper\Data::getReferenceDecryptOrderID($payment->getReference());
                $order = $this->_order->load($order);
                if ($this->getStoreReference() == \UOL\PagSeguro\Helper\Data::getReferenceDecrypt(
                        $payment->getReference())
                ) {
                    if (!is_null($this->_session->getData('store_id'))) {
                        array_push($this->_arrayPayments, $this->build($payment, $order));
                    }
                    if ($order) {
                        array_push($this->_arrayPayments, $this->build($payment, $order));
                    }
                }
            }
        }
        date_default_timezone_set($this->_timezone->getConfigTimezone());

        return $this->_arrayPayments;
    }
1070112
public function startSession()
    {
        return (string) $this->sendTransaction([
          'email' => $this->email,
          'token' => $this->token,
        ], $this->url['session'])->id;
    }
1038608
public function beginTransaction() : bool
    {
        $result = @$this->getConnection()->exec('BEGIN TRANSACTION');

        if ($result === false) {
            throw new ParserRuntimeException('Transaction could not be started.', 0);
        }

        return $result;
    }
487381
public function startTransaction(): bool {
        if ($this->transactionExists) {
            return false;
        }
        $started = $this->pdo->beginTransaction();
        $this->transactionExists = $started;
        return $started;
    }
968485
public function beginTransaction()
    {
        $return = $this->repository->beginTransaction();

        if ($this->signalDispatcher instanceof TransactionHandler) {
            $this->signalDispatcher->beginTransaction();
        }

        return $return;
    }
61073
public function actionInit()
	{
		if (!InstallerModule::checkDbConnection())
			Yii::$app->db->open();

		// Flush the caches
		if (Yii::$app->cache) {
			Yii::$app->cache->flush();
		}

		// todo make migration better
		$data = file_get_contents((dirname(__DIR__) . '/migrations/data.sql'));
		Yii::$app->db->createCommand($data)->execute();

		return $this->redirect(Yii::$app->urlManager->createUrl('//installer/config/index'));
	}
994114
public function begin()
    {
        // we'll rely on buffer to respond data that has not yet committed, so
        // it must never evict from cache - I'd even rather see the app crash
        $buffer = new Buffer(ini_get('memory_limit'));

        // transactions can be nested: the previous transaction will serve as
        // cache backend for the new cache (so when committing a nested
        // transaction, it will commit to the parent transaction)
        $cache = end($this->transactions);
        $this->transactions[] = new Transaction($buffer, $cache);
    }
428704
public function getPaymentCnt()
    {
        if ($this->_iPaymentCnt === null) {
            $this->_iPaymentCnt = false;

            if ($oPaymentList = $this->getPaymentList()) {
                $this->_iPaymentCnt = count($oPaymentList);
            }
        }

        return $this->_iPaymentCnt;
    }
1263117
protected function beginTransaction()
    {
        $modelClass = $this->modelClass;
        $transaction = $modelClass::getDb()->beginTransaction();

        $this->_transaction[] = $transaction;
    }
527315
protected function sendPayRequest()
    {
        $this->newTransaction();
        $fields = [
            'api'      => $this->config->get('gateway.payir.api'),
            'amount'   => $this->amount,
            'redirect' => $this->getCallback(),
        ];

        if (isset($this->factorNumber))
            $fields['factorNumber'] = $this->factorNumber;

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $this->serverUrl);
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($fields));
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        $response = curl_exec($ch);
        $response = json_decode($response, true);
        curl_close($ch);
        if (is_numeric($response['status']) && $response['status'] > 0) {
            $this->refId = $response['transId'];
            $this->transactionSetRefId();
            return true;
        }
        $this->transactionFailed();
        $this->newLog($response['errorCode'], PayirSendException::$errors[ $response['errorCode'] ]);
        throw new PayirSendException($response['errorCode']);
    }