Formats the local database transaction into ripple-rest Payment format

@param {RippleAddress} account
@param {Transaction} transaction
@param {Function} callback

@callback
@param {Error} error
@param {RippleRestTransaction} transaction
517736
function formatPaymentHelper(account, txJSON) {
  if (!(txJSON && /^payment$/i.test(txJSON.TransactionType))) {
    throw new InvalidRequestError('Not a payment. The transaction '
      + 'corresponding to the given identifier is not a payment.');
  }
  var metadata = {
    client_resource_id: txJSON.client_resource_id || '',
    hash: txJSON.hash || '',
    ledger: String(!_.isUndefined(txJSON.inLedger) ?
      txJSON.inLedger : txJSON.ledger_index),
    state: txJSON.validated === true ? 'validated' : 'pending'
  };
  var message = {tx_json: txJSON};
  var meta = txJSON.meta;
  var parsed = TxToRestConverter.parsePaymentFromTx(account, message, meta);
  return _.assign({payment: parsed.payment}, metadata);
}
1060756
public void localCommit()
    {
        if (log.isDebugEnabled()) log.debug("commit was called");
        if (!this.isInLocalTransaction)
        {
            throw new TransactionNotInProgressException("Not in transaction, call begin() before commit()");
        }
        try
        {
            if(!broker.isManaged())
            {
                if (batchCon != null)
                {
                    batchCon.commit();
                }
                else if (con != null)
                {
                    con.commit();
                }
            }
            else
            {
                if(log.isDebugEnabled()) log.debug(
                        "Found managed environment setting in PB, will skip Connection.commit() call");
            }
        }
        catch (SQLException e)
        {
            log.error("Commit on underlying connection failed, try to rollback connection", e);
            this.localRollback();
            throw new TransactionAbortedException("Commit on connection failed", e);
        }
        finally
        {
            this.isInLocalTransaction = false;
            restoreAutoCommitState();
            this.releaseConnection();
        }
    }
1362503
public void rollbackTransaction() throws MarkLogicTransactionException {
		if(isActiveTransaction()) {
			try {
				sync();
			} catch (MarkLogicSesameException e) {
				throw new MarkLogicTransactionException(e);
			}
			this.tx.rollback();
			this.tx = null;
		}else{
			throw new MarkLogicTransactionException("No active transaction to rollback.");
		}
	}
969629
public static AccountInfo adaptAccountInfo(
      final RippleAccountBalances account, final String username) {

    // Adapt account balances to XChange balances
    final Map<String, List<Balance>> balances = new HashMap<>();
    for (final RippleBalance balance : account.getBalances()) {
      final String walletId;
      if (balance.getCurrency().equals("XRP")) {
        walletId = null;
      } else {
        walletId = balance.getCounterparty();
      }
      if (!balances.containsKey(walletId)) {
        balances.put(walletId, new LinkedList<Balance>());
      }
      balances
          .get(walletId)
          .add(new Balance(Currency.getInstance(balance.getCurrency()), balance.getValue()));
    }

    final List<Wallet> accountInfo = new ArrayList<>(balances.size());
    for (final Map.Entry<String, List<Balance>> wallet : balances.entrySet()) {
      accountInfo.add(new Wallet(wallet.getKey(), wallet.getValue()));
    }

    return new AccountInfo(username, BigDecimal.ZERO, accountInfo);
  }
789096
void localTransactionStarted(final SibRaConnection connection) {

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, "localTransactionStarted", connection);
        }

        final ConnectionEvent event = new ConnectionEvent(this,
                ConnectionEvent.LOCAL_TRANSACTION_STARTED);
        event.setConnectionHandle(connection);

        for (Iterator iterator = _eventListeners.iterator(); iterator.hasNext();) {

            final ConnectionEventListener listener = (ConnectionEventListener) iterator
                    .next();
            listener.localTransactionStarted(event);

        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, "localTransactionStarted");
        }
    }
1096203
function (params) {
  const oThis = this
  ;

  params = params || {};
  oThis.transactionHash = params.transaction_hash;
  oThis.chain = 'value';
}
1060773
function transactionError(response, message, body) {
  var content = errorContent(ErrorType.transaction, message, body);
  send(response, content, StatusCode.internalServerError);
}
877888
function() {
        console.log(
            `LocalIndexedDBStoreBackend: loading account data...`,
        );
        return Promise.try(() => {
            const txn = this.db.transaction(["accountData"], "readonly");
            const store = txn.objectStore("accountData");
            return selectQuery(store, undefined, (cursor) => {
                return cursor.value;
            }).then((result) => {
                console.log(
                    `LocalIndexedDBStoreBackend: loaded account data`,
                );
                return result;
            });
        });
    }
258156
function(options, callback) {
    // var self = this

    if (typeof options === 'function') {
      callback = options
      options = {}
    }

    if (options.transaction) {
      return callback(options.transaction)
    } else {
      return this.connection
        .transaction(function(transaction) {
          options.transaction = transaction
          return callback(transaction)
        })
        .then(function(result) {
          debug('commit')
          return result
        })
        .catch(function(e) {
          // TODO: do something with e.g. 'afterSave' rollback message!?!
          debug('rollback')
          throw e
        })
    }
  }
171103
def state_preorder_put_account_payment_info( nameop, account_addr, token_type, amount ):
    
    assert amount is None or isinstance(amount, (int,long)), 'Amount is {} (type {})'.format(amount, type(amount))
    assert account_addr is None or isinstance(account_addr, (str,unicode))
    assert token_type is None or isinstance(token_type, (str,unicode))
    nameop['__account_payment_info__'] = {
            'address': str(account_addr) if account_addr is not None else None,
            'type': str(token_type) if token_type is not None else None,
            'amount': int(amount) if amount is not None else None
    }
220067
function createPayment(data, callback) {
    var client = new this.clients.Payments();
    client.create(data, callback);
  }
818133
function _logTransaction($listenerName, $transactionStatus, $transactionMessage, $pdtResponse = null)
    {
        // Store the standard log information
        $om = $this->objectManager;
        if (!is_null($this->logID)) {
            $ipnLog  = $om->getRepository($this->clsIpnLog)->find($this->logID);
        } else {
            $ipnLog = new $this->clsIpnLog;
        }
        
        $ipnLog->setListenerName($listenerName);
        $ipnLog->setTransactionType(null);
        $ipnLog->setTransactionId($this->transactionID);
        $ipnLog->setStatus($transactionStatus);
        $ipnLog->setMessage($transactionMessage);
        
        if(!$ipnLog->getCreatedAt())
            $ipnLog->setCreatedAt(new \DateTime());
        $ipnLog->setUpdatedAt(new \DateTime());

        if ($transactionStatus == 'FAIL' || !$this->isLive) {
            $detailJSON = array();
            $detailJSON['pdt_response'] = $pdtResponse;
            $ipnLog->setDetail(json_encode($detailJSON));
        } else {
            $ipnLog->setDetail(null); // Turn it back to null (as it might have been set previously)
        }

        // Finally save down the log record.
        $om->persist($ipnLog);
        $om->flush();

        if (is_null($this->logID)) {
            $this->logID = $ipnLog->getId(); // Save the log ID for next time if we need to.
        }
    }
4007
public function createTransaction(Transaction $transaction, array $params = [])
    {
        $this->getClient()->createAccountTransaction($this, $transaction, $params);
    }
30736
function IDBTransaction(db, storeNames, mode) {
        this.__id = ++uniqueID; // for debugging simultaneous transactions
        this.__active = true;
        this.__running = false;
        this.__errored = false;
        this.__requests = [];
        this.__storeNames = storeNames;
        this.mode = mode;
        this.db = db;
        this.error = null;
        this.onabort = this.onerror = this.oncomplete = null;

        // Kick off the transaction as soon as all synchronous code is done.
        var me = this;
        setTimeout(function() { me.__executeRequests(); }, 0);
    }
238320
Ab.BroadcastResponse sendTransaction(Common.Envelope transaction) throws Exception {
        if (shutdown) {
            throw new TransactionException(format("Orderer %s was shutdown.", name));
        }

        logger.debug(format("Orderer.sendTransaction %s", toString()));

        OrdererClient localOrdererClient = getOrdererClient();

        try {
            return localOrdererClient.sendTransaction(transaction);
        } catch (Throwable t) {
            removeOrdererClient(true);
            throw t;

        }

    }
39836
function(accountData) {
        return Promise.try(() => {
            const txn = this.db.transaction(["accountData"], "readwrite");
            const store = txn.objectStore("accountData");
            for (let i = 0; i < accountData.length; i++) {
                store.put(accountData[i]); // put == UPSERT
            }
            return txnAsPromise(txn);
        });
    }
679387
function createCardTransaction(cardId, _ref2, commit, otp, options) {
  let amount = _ref2.amount,
      currency = _ref2.currency,
      destination = _ref2.destination,
      origin = _ref2.origin,
      message = _ref2.message,
      securityCode = _ref2.securityCode;

  options = (0, _lodash2.default)({
    body: {
      denomination: {
        amount: amount,
        currency: currency
      },
      destination: destination,
      message: message,
      origin: origin,
      securityCode: securityCode
    },
    method: 'post'
  }, options);

  if (commit) {
    options.queryParams = _extends({
      commit: true
    }, options.queryParams);
  }

  if (otp) {
    options.headers = _extends({
      'otp-token': otp
    }, options.headers);
  }

  return this.api(`/me/cards/${cardId}/transactions`, options);
}