Deprecated. Use Braintree::Transaction.submit_for_settlement
5351
def submit_for_settlement(amount = nil)
      warn "[DEPRECATED] submit_for_settlement as an instance method is deprecated. Please use Transaction.submit_for_settlement"
      result = @gateway.transaction.submit_for_settlement(id, amount)
      if result.success?
        copy_instance_variables_from_object result.transaction
      end
      result
    end
1259367
def add_transaction(self,
                        block_header: BlockHeader,
                        index_key: int,
                        transaction: 'BaseTransaction') -> Hash32:
        
        transaction_db = HexaryTrie(self.db, root_hash=block_header.transaction_root)
        transaction_db[index_key] = rlp.encode(transaction)
        return transaction_db.root_hash
1290185
def close(self, out_trade_no):
        
        data = {
            'appid': self.appid,
            'out_trade_no': out_trade_no,
        }
        return self._post('pay/closeorder', data=data)
983684
private function _submitTransaction($transaction, $txnType, $clientTransactionId = null)
    {
        $options = array();
        if ($clientTransactionId !== null) {
            $options['clientTransactionId'] = $clientTransactionId;
        }
        $rsp = $this->doRequest($transaction, $options);
        HpsGatewayResponseValidation::checkResponse($rsp, $txnType);
        $response = HpsCheckResponse::fromDict($rsp, $txnType);

        if ($response->responseCode != 0) {
            throw new HpsCheckException(
                $rsp->Header->GatewayTxnId,
                $response->details,
                $response->responseCode,
                $response->responseText
            );
        }

        return $response;
    }
837205
def execute(self, **kwargs):
    
    assert self.resp is None, "Transaction already committed"
    try:
      self.resp = self.db.tx(list(self.edn_iter), **kwargs)
    except Exception:
      self.resp = False
      raise
    else:
      self.resolve()
      self.adds = None
      self.tmpents = None
    return self.resp
58440
def do_transaction(self, function, *args, **kwargs):
        """"""
        with self.config.db_transaction() as trans:
            function(trans, *args, **kwargs)
519474
def submit
      submit!
    rescue Exception => e
      if e.respond_to?(:record)
        inherit_errors(e.record) unless e.record == self
        false
      else
        raise
      end
    end
80103
def _handle_delete(self, transaction):
        
        path = str("/" + transaction.request.uri_path)
        transaction.response = Response()
        transaction.response.destination = transaction.request.source
        transaction.response.token = transaction.request.token
        try:
            resource = self._server.root[path]
        except KeyError:
            resource = None

        if resource is None:
            transaction.response.code = defines.Codes.NOT_FOUND.number
        else:
            # Delete
            transaction.resource = resource
            transaction = self._server.resourceLayer.delete_resource(transaction, path)
        return transaction
56222
private void postCommit(DbSession dbSession, Collection<String> logins, Collection<EsQueueDto> items) {
    index(dbSession, items);
  }
476925
def post(self, amount, other_account, description, self_memo="", other_memo="", datetime=None):
        

        #Note: debits are always positive, credits are always negative.  They should be negated before displaying
        #(expense and liability?) accounts
        tx = self._new_transaction()

        if datetime:
            tx.t_stamp = datetime
        #else now()

        tx.description = description
        tx.save()

        a1 = self._make_ae(self._DEBIT_IN_DB() * amount, self_memo, tx)
        a1.save()
        a2 = other_account._make_ae(-self._DEBIT_IN_DB() * amount, other_memo, tx)
        a2.save()

        return (a1, a2)
586834
def submit(cls, client, direction, legs, price, quantity, time_in_force,
               trigger, order_type, run_validations=True):
        '''
        
        '''

        if run_validations:
            assert(direction in ["debit", "credit"])
            assert(type(price) is str)
            assert(type(quantity) is int)
            assert(time_in_force in ["gfd", "gtc"])
            assert(trigger in ["immediate"])
            assert(order_type in ["limit", "market"])
            assert(cls._validate_legs(legs) is True)

        payload = json.dumps({
            "account": client.account_url,
            "direction": direction,
            "legs": legs,
            "price": price,
            "quantity": quantity,
            "time_in_force": time_in_force,
            "trigger": trigger,
            "type": order_type,
            "override_day_trade_checks": False,
            "override_dtbp_checks": False,
            "ref_id": str(uuid.uuid4())
        })

        request_url = "https://api.robinhood.com/options/orders/"
        data = client.post(request_url, payload=payload)
        return data
285068
def _close(self, close_type):

		'''
		
		'''

		# commit transaction
		txn_response = self.api.http_request('POST','%sfcr:tx/fcr:%s' % (self.root, close_type), data=None, headers=None)

		# if 204, transaction was closed
		if txn_response.status_code == 204:
			logger.debug("%s for transaction: %s, successful" % (close_type, self.root))
			# update self.active
			self.active = False
			# return
			return True

		# if 410 or 404, transaction does not exist
		elif txn_response.status_code in [404, 410]:
			logger.debug("transaction does not exist: %s" % self.root)
			# update self.active
			self.active = False
			return False

		else:
			raise Exception('HTTP %s, could not commit transaction' % txn_response.status_code)
811408
def commit(self):
        
        self._check_state()
        database = self._session._database
        api = database.spanner_api
        metadata = _metadata_with_prefix(database.name)
        txn_options = TransactionOptions(read_write=TransactionOptions.ReadWrite())
        response = api.commit(
            self._session.name,
            self._mutations,
            single_use_transaction=txn_options,
            metadata=metadata,
        )
        self.committed = _pb_timestamp_to_datetime(response.commit_timestamp)
        return self.committed
1222585
async def _submit(self, req_json: str) -> str:
        

        LOGGER.debug('BaseAnchor._submit >>> req_json: %s', req_json)

        if not self.pool:
            LOGGER.debug('BaseAnchor._submit <!< absent pool')
            raise AbsentPool('Cannot submit request: absent pool')

        if not self.pool.handle:
            LOGGER.debug('BaseAnchor._submit <!< closed pool %s', self.pool.name)
            raise ClosedPool('Cannot submit request to closed pool {}'.format(self.pool.name))

        rv_json = await ledger.submit_request(self.pool.handle, req_json)
        await asyncio.sleep(0)

        resp = json.loads(rv_json)
        if resp.get('op', '') in ('REQNACK', 'REJECT'):
            LOGGER.debug('BaseAnchor._submit <!< ledger rejected request: %s', resp['reason'])
            raise BadLedgerTxn('Ledger rejected transaction request: {}'.format(resp['reason']))

        LOGGER.debug('BaseAnchor._submit <<< %s', rv_json)
        return rv_json
771121
def rollback(self):
        
        try:
            if self._autocommit:
                return

            if not self._conn or not self._conn.is_connected():
                return

            if not self._conn.tds72_transaction:
                return

            self._main_cursor._rollback(cont=True,
                                        isolation_level=self._isolation_level)
        except socket.error as e:
            if e.errno in (errno.ENETRESET, errno.ECONNRESET, errno.EPIPE):
                return
            self._conn.close()
            raise
        except ClosedConnectionError:
            pass
10738
private void commitTransaction() {
        Tenant tenant = Tenant.getTenant(m_tableDef);
        DBTransaction dbTran = DBService.instance(tenant).startTransaction();
        m_parentTran.applyUpdates(dbTran);
        DBService.instance(tenant).commit(dbTran);
        m_parentTran.clear();
    }
1169137
def tryCommit(self, prepare: Prepare):
        
        rv, reason = self.canCommit(prepare)
        if rv:
            self.doCommit(prepare)
        else:
            self.logger.debug("{} cannot send COMMIT since {}".format(self, reason))