Convert JTA transaction status to String representation
359230
public static String printStatus(int status)
    {
        switch (status)
        {
        case Status.STATUS_ACTIVE:
            return "Status.STATUS_ACTIVE";
        case Status.STATUS_COMMITTED:
            return "Status.STATUS_COMMITTED";
        case Status.STATUS_COMMITTING:
            return "Status.STATUS_COMMITTING";
        case Status.STATUS_MARKED_ROLLBACK:
            return "Status.STATUS_MARKED_ROLLBACK";
        case Status.STATUS_NO_TRANSACTION:
            return "Status.STATUS_NO_TRANSACTION";
        case Status.STATUS_PREPARED:
            return "Status.STATUS_PREPARED";
        case Status.STATUS_PREPARING:
            return "Status.STATUS_PREPARING";
        case Status.STATUS_ROLLEDBACK:
            return "Status.STATUS_ROLLEDBACK";
        case Status.STATUS_ROLLING_BACK:
            return "Status.STATUS_ROLLING_BACK";
        default:
            return "Status.STATUS_UNKNOWN";
        }
    }
690537
@Override
    public int getStatus() throws SystemException
    {
        Transaction tx = threadLocal.get();
        if (tx == null)
        {
            return Status.STATUS_NO_TRANSACTION;
        }
        return tx.getStatus();
    }
39782
def encode_transit(records):
    ''''''
    with StringIO() as buf:
        writer = Writer(buf, "json")
        writer.write(records)
        return buf.getvalue().encode('utf8')
179831
def transaction_status(token)
      payload = { :token => token }
      result = http_json_request(MPower::Setup.direct_mobile_tx_status_base_url,payload)

      if result["response_code"] == "00"
        @tx_status = result["tx_status"]
        @mobile_invoice_no = result["mobile_invoice_no"]
        @cancel_reason = result["cancel_reason"]
        push_results(result)
        true
      else
        push_results(result)
        false
      end
    end
907717
public static String getStatusAsString(int status)
   {
      if (status >= Status.STATUS_ACTIVE && status <= Status.STATUS_ROLLING_BACK)
      {
         return TX_STATUS_STRINGS[status];
      }
      else
      {
         return "STATUS_INVALID(" + status + ")";
      }
   }
331502
function _formatStatus(status) {
    let statusColorFn = chalk.grey;
    if (_.endsWith(status, 'IN_PROGRESS')) {
        statusColorFn = chalk.yellow;
    } else if (_.endsWith(status, 'FAILED') || _.startsWith(status, 'DELETE')) {
        statusColorFn = chalk.red;
    } else if (_.endsWith(status, 'COMPLETE')) {
        statusColorFn = chalk.greenBright;
    }

    const sanitizedStatus = _.replace(status, '_', ' ');
    const paddedStatus = _.padEnd(sanitizedStatus, STACK_EVENT_STATUS_DISPLAY_LENGTH);
    return statusColorFn(paddedStatus);
}
737446
def deserialize_transactions(transactions_json)
      Array(transactions_json).map do |trans_json|
        FioAPI::Transaction.new(
          transaction_id:         trans_json.try_path('column22', 'value'),
          date:                   trans_json.try_path('column0', 'value'),
          amount:                 trans_json.try_path('column1', 'value'),
          currency:               trans_json.try_path('column14', 'value'),
          account:                trans_json.try_path('column2', 'value'),
          account_name:           trans_json.try_path('column10', 'value'),
          bank_code:              trans_json.try_path('column3', 'value'),
          bank_name:              trans_json.try_path('column12', 'value'),
          ks:                     trans_json.try_path('column4', 'value'),
          vs:                     trans_json.try_path('column5', 'value'),
          ss:                     trans_json.try_path('column6', 'value'),
          user_identification:    trans_json.try_path('column7', 'value'),
          message_for_recipient:  trans_json.try_path('column16', 'value'),
          transaction_type:       trans_json.try_path('column8', 'value'),
          sender:                 trans_json.try_path('column9', 'value'),
          detail_info:            trans_json.try_path('column18', 'value'),
          comment:                trans_json.try_path('column25', 'value'),
          bic:                    trans_json.try_path('column26', 'value'),
          action_id:              trans_json.try_path('column17', 'value')
        )
      end
    end
578420
@Override
	public int getStatus() throws TransactionManagementException {
		logger.entering(CLASSNAME, "getStatus");
		int status = 0;
		
		try {
			status = userTran.getStatus();
			logger.log(Level.FINE, "javax.transaction.Status: {0}", status);
		} catch (SystemException e) {
			throw new TransactionManagementException(e);
		}
		logger.exiting(CLASSNAME, "getStatus", status);
		return status;
	}
736563
function getRowBytesFromTransactionBase64(base64Data) {
  let bytesDecode = base64DecodeFromString(base64Data);
  let transaction = proto.protocol.Transaction.deserializeBinary(bytesDecode);
  let raw = transaction.getRawData();
  return raw.serializeBinary();
}
923343
function statusAction (type, status, data) {
  return {
    type: LP_API_ACTION_NAMESPACE + type,
    payload: { type, status, data }
  }
}
773810
public static String stringify(final ResponseStatus status, final ResponseStatusDetails details) {
        String result = status.toString();
        if (details != null) {
            result = result + " (Context: " + details.context() + ", Reference: " + details.reference() + ")";
        }
        return result;
    }
931862
function verifyTransactionName(name) {
	if (typeof name !== 'string' || name.length === 0) {
		const msg = util.format('Transaction name must be a non-empty string: %j', name);
		logger.error('verifyTransactionName:', msg);
		throw new Error(msg);
	}
}
862608
def ToJson(self):
        
        jsn = super(MinerTransaction, self).ToJson()
        jsn['nonce'] = self.Nonce
        return jsn
1341427
def _parse_transaction_entry(entry):
    
    parts = entry.split()

    date_string = parts[0]
    try:
        date = datetime.datetime.strptime(date_string[:-1], '%Y-%m-%d').date()
    except ValueError:
        raise ValueError('Invalid date in vacationrc for entry: {}'.format(entry))

    if len(parts) < 2:
        raise ValueError('.vacationrc missing an action for entry: {}'.format(entry))
    action = parts[1].lower()
    if action not in ('days', 'rate', 'off', 'adjust', 'show'):
        raise ValueError('Invalid action in vacationrc for entry: {}'.format(entry))

    try:
        value = float(parts[2])
    except IndexError:
        value = None
    except (ValueError, TypeError):
        raise ValueError('Invalid value in vacationrc for entry: {}'.format(entry))

    return (date, action, value)
472034
def post_transaction(self, transaction, mode):
        """"""
        if not mode or mode not in self.mode_list:
            raise ValidationError('Mode must be one of the following {}.'
                                  .format(', '.join(self.mode_list)))

        tx_dict = transaction.tx_dict if transaction.tx_dict else transaction.to_dict()
        payload = {
            'method': mode,
            'jsonrpc': '2.0',
            'params': [encode_transaction(tx_dict)],
            'id': str(uuid4())
        }
        # TODO: handle connection errors!
        return requests.post(self.endpoint, json=payload)
1095079
protected function parseTransactionDescription()
    {
        $results = [];
        if (preg_match_all('/[\n]:86:(.*?)(?=\n(:6([12]))|$)/s', $this->getCurrentTransactionData(), $results)
            && !empty($results[1])
        ) {
            return $this->sanitizeDescription(implode(PHP_EOL, $results[1]));
        }

        return '';
    }
1053328
@Override
    public String convertToString(T object) {
        try {
            return (String) toString.invoke(object);
        } catch (IllegalAccessException ex) {
            throw new IllegalStateException("Method is not accessible: " + toString);
        } catch (InvocationTargetException ex) {
            if (ex.getCause() instanceof RuntimeException) {
                throw (RuntimeException) ex.getCause();
            }
            throw new RuntimeException(ex.getMessage(), ex.getCause());
        }
    }