Make a transfer.

@param Transfer $transfer
@param VendorInterface $vendor

@return int

@throws Exception
161967
private function transferSoap(Transfer $transfer, VendorInterface $vendor = null)
    {
        if (!$transfer->getEntity()) {
            $transfer->setEntity($this->entity);
        }
        $parameters = $transfer->mergeIntoParameters();
        if ($vendor) {
            $parameters = $this->mergeSubAccountParameters($vendor);
        }
        $result = $this->callSoap('direct', $parameters);

        return $result['transactionId'];
    }
1368118
private function _submitTransaction($transaction, $txnType, $clientTxnId = null, $cardData = null)
    {
        $options = array();
        if ($clientTxnId !== null) {
            $options['clientTransactionId'] = $clientTxnId;
        }

        try {
            $response = $this->doRequest($transaction, $options);
        } catch (HpsException $e) {
            if ($e->innerException != null && $e->innerException->getMessage() == 'gateway_time-out') {
                if ($txnType == 'DebitSale') {
                    try {
                        $this->reverse($cardData, $this->_amount, $this->_currency);
                    } catch (Exception $e) {
                        throw new HpsGatewayException('0', HpsExceptionCodes::GATEWAY_TIMEOUT_REVERSAL_ERROR);
                    }
                }
                throw new HpsException('An error occurred and the gateway has timed out', 'gateway_timeout', $e, 'gateway_timeout');
            }
            throw $e;
        }

        $this->_processChargeGatewayResponse($response, $txnType);
        $this->_processChargeIssuerResponse($response, $txnType);

        $rvalue = null;
        switch ($txnType) {
            case 'DebitSale':
                $rvalue = HpsDebitSale::fromDict($response, $txnType);
                break;
            case 'DebitAddValue':
                $rvalue = HpsDebitAddValue::fromDict($response, $txnType);
                break;
            case 'DebitReturn':
                $rvalue = HpsDebitReturn::fromDict($response, $txnType);
                break;
            case 'DebitReversal':
                $rvalue = HpsDebitReversal::fromDict($response, $txnType);
                break;
            default:
                break;
        }

        return $rvalue;
    }
58641
public static function do(ConnectorInterface $connector, $privateActiveWif, $from, $to, $amountWithAsset, $memo)
    {
        $chainName = $connector->getPlatform();
        /** @var CommandQueryData $tx */
        $tx = Transaction::init($connector);
        $tx->setParamByKey(
            '0:operations:0',
            [
                'transfer',
                [
                    'from'   => $from,
                    'to'     => $to,
                    'amount' => $amountWithAsset,
                    'memo'   => $memo
                ]
            ]
        );

        $command = new BroadcastTransactionCommand($connector);
        Transaction::sign($chainName, $tx, ['active' => $privateActiveWif]);

        $answer = $command->execute(
            $tx
        );

        return $answer;
    }
1348641
public function processTransaction(array $transactionData, string $operation): ProcessInterface
    {
        // When hitting the process endpoint, we only need the transactionId and operation key/value pairs, and
        // optionally the transactionAmount if we are capturing a portion of the total amount.
        $transactionData = array_filter($transactionData + ['operation' => $operation], function ($k) {
            return in_array($k, ['transactionId', 'operation', 'transactionAmount']);
        }, ARRAY_FILTER_USE_KEY);

        $uri = $this->getUri('process', $this->getParameters($transactionData));
        /** @var ProcessInterface $response */
        $response = $this->performRequest((string) $uri);

        Assert::isInstanceOf($response, ProcessInterface::class, 'Invalid response');

        return $response;
    }
76039
public function DMSTransaction($txn_id, $amount, $currency = 981, $description = '', $language = 'GE')
    {
        return $this->transaction('t', $amount, $currency, $description, $language, 'DMS', [
            'trans_id' => $txn_id,
        ]);
    }
983898
private function getHttpClient($endpoint, TransferInterface $transfer, $needsPublicKey = false) {
        // Prepare the headers
        $headers = $transfer->getHeaders();
        if ($needsPublicKey) {
            $headers['Authorization'] = $this->gatewayConfig->getPublicKey();
        }

        // Build the client
        $client = new ZendClient($endpoint);
        $client->setMethod('POST');
        $client->setRawData( json_encode( $transfer->getBody()) ) ;
        $client->setHeaders($headers);
        
        return $client;
    }
12601
static public function calculateForTransaction(Transaction $transaction)
    {
        // generate each content fee accordingly
        $msgFee = self::calculateForMessage($transaction->message());

        // default content fee is XEM amount transfer fee
        $contentFee = Fee::FEE_FACTOR * self::calculateForXEM($transaction->amount()->toMicro() / Amount::XEM);

        // get the Transaction extension fee
        $extensionFee = $transaction->extendFee();

        if ($extensionFee > 0) {
            $contentFee = (int) $extensionFee;
        }

        return $msgFee + $contentFee;
    }
204822
public function deleteDocument(TransferInterface $transfer, $containerName)
    {
        $this->checkTransferMethods($transfer);

        $fileName = $transfer->getFileName();
        $relativePath = $transfer->getRelativePath();

        return $this->fileUploadFacade->deleteFile($containerName, $fileName, $relativePath);
    }
955008
public function bankInfosRegister(
        VendorInterface $vendor,
        BankInfo $bankInfo
    ) {

        $this->resetRestClient();

        $this->restClient->getConfig()->setPath(
            'request.options/headers/php-auth-user',
            $this->login
        );

        $this->restClient->getConfig()->setPath(
            'request.options/headers/php-auth-pw',
            $this->password
        );

        if (!is_null($vendor->getHiPayId())) {
            $this->restClient->getConfig()->setPath(
                'request.options/headers/php-auth-subaccount-id',
                $vendor->getHiPayId()
            );
        }

        $parameters = $bankInfo->mergeIntoParameters();

        $command = $this->restClient->getCommand(
            'RegisterBankInfo',
            $parameters
        );
        $result = $this->executeRest($command, $parameters);

        return $result;
    }
1271551
public function importCompanyRolePermissions(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer
    {
        return $this->getFactory()->createCompanyRolePermissionDataImport()->import($dataImporterConfigurationTransfer);
    }
510408
private function setTransaction(TransactionInterface $transaction) {
        $transactions = $this->getTransactions();
        $transactions[$this->getDbService()] = $transaction;
        $this->setTransactions($transactions);
    }
87474
public function applyTransactionId(TransactionInterface $transaction)
    {
        $transactionId = $transaction->get('txn_id', null);

        if (!$transactionId) {
            // no transaction id provided
            $transactionId = -1;
        }

        $transaction->setTransactionId($transactionId);
    }
47225
public function queryTransfers($partner_trade_no)
    {
        $pay = new Transfers($this->config->get());
        return $pay->query($partner_trade_no);
    }
112949
protected function sendBankAccount(VendorInterface $vendor, BankInfo $bankInfo)
    {
        $event = new AddBankAccount($bankInfo);

        $this->dispatcher->dispatch('before.bankAccount.add', $event);

        return $this->hipay->bankInfosRegister($vendor, $event->getBankInfo());
    }
75947
private void transfer() {

        saveTable();
        updateEnabled(false);
        trace("Start Transfer");

        int           TransferIndex = CurrentTransfer;
        int           AlterIndex    = CurrentAlter;
        TransferTable t             = null;
        long          startTime, stopTime;

        startTime = System.currentTimeMillis();

        try {
            for (int i = TransferIndex; i < tTable.size(); i++) {
                CurrentTransfer = i;
                t               = (TransferTable) tTable.elementAt(i);

                lTable.select(i);
                displayTable(t);
                t.transferStructure();
                t.transferData(iMaxRows);
            }

            for (int i = AlterIndex; i < tTable.size(); i++) {
                CurrentAlter = i;
                t            = (TransferTable) tTable.elementAt(i);

                lTable.select(i);
                displayTable(t);
                t.transferAlter();
            }

            stopTime = System.currentTimeMillis();

            trace("Transfer finished successfully in: "
                  + (stopTime - startTime) / 1000.00 + " sec");

            if (iTransferMode == TRFM_TRANSFER) {
                bContinue.setLabel("Quit");
                bContinue.setEnabled(true);
                bContinue.invalidate();
            } else {
                bStart.setLabel("Quit");
                bStart.setEnabled(true);
                bStart.invalidate();
            }
        } catch (Exception e) {
            String last = tMessage.getText();

            trace("Transfer stopped - " + last + " /  / Error: "
                  + e.getMessage());
            e.printStackTrace();
        }

        if (iTransferMode == TRFM_TRANSFER) {
            bContinue.setEnabled((CurrentAlter < tTable.size()));
        }

        updateEnabled(true);
        System.gc();
    }
400638
private function _submitTransaction($transaction, $txnType, $clientTxnId = null, $cardData = null)
    {
        $options = array();
        if ($clientTxnId != null) {
            $options['clientTransactionId'] = $clientTxnId;
        }

        try {
            $response = $this->doRequest($transaction, $options);
        } catch (HpsException $e) {
            if ($e->innerException != null && $e->innerException->getMessage() == 'gateway_time-out') {
                if (in_array($txnType, array('CreditSale', 'CreditAuth'))) {
                    try {
                        $this->reverse($cardData, $this->_amount, $this->_currency);
                    } catch (Exception $e) {
                        throw new HpsGatewayException('0', HpsExceptionCodes::GATEWAY_TIMEOUT_REVERSAL_ERROR);
                    }
                }
                throw new HpsException('An error occurred and the gateway has timed out', 'gateway_timeout', $e, 'gateway_timeout');
            }
            throw $e;
        }

        $this->_processChargeGatewayResponse($response, $txnType);
        $this->_processChargeIssuerResponse($response, $txnType);

        $rvalue = null;
        switch ($txnType) {
            case 'ReportTxnDetail':
                $rvalue = HpsReportTransactionDetails::fromDict($response, $txnType);
                break;
            case 'ReportActivity':
                $rvalue = HpsReportTransactionSummary::fromDict($response, $txnType, $this->_filterBy);
                break;
            case 'CreditSale':
                $rvalue = HpsCharge::fromDict($response, $txnType);
                break;
            case 'CreditAccountVerify':
                $rvalue = HpsAccountVerify::fromDict($response, $txnType);
                break;
            case 'CreditAuth':
                $rvalue = HpsAuthorization::fromDict($response, $txnType);
                break;
            case 'CreditReturn':
                $rvalue = HpsRefund::fromDict($response, $txnType);
                break;
            case 'CreditReversal':
                $rvalue = HpsReversal::fromDict($response, $txnType);
                break;
            case 'CreditVoid':
                $rvalue = HpsVoid::fromDict($response, $txnType);
                break;
            case 'CreditCPCEdit':
                $rvalue = HpsCPCEdit::fromDict($response, $txnType);
                break;
            case 'CreditTxnEdit':
                $rvalue = HpsTransaction::fromDict($response, $txnType);
                break;
            case 'RecurringBilling':
                $rvalue = HpsRecurringBilling::fromDict($response, $txnType);
                break;
            case 'ManageTokens':
                $rvalue = HpsManageTokensResponse::fromDict($response);
                break;
            default:
                break;
        }

        return $rvalue;
    }
787125
protected function renderFile(TransferInterface $transfer, $containerName, $fullFilePath)
    {
        $this->converterProxy->convertToFile($transfer, $containerName, $fullFilePath);
    }