Package ru.bitel.bgbilling.modules.yoomoney.server.bean

# Class TransactionManager

java.lang.Object
ru.bitel.bgbilling.kernel.base.server.logger.BGLogger
ru.bitel.bgbilling.common.dao.AbstarctDaoConstant
ru.bitel.bgbilling.common.dao.AbstractDao<B>
ru.bitel.bgbilling.common.dao.AbstractIdDao<B>
ru.bitel.bgbilling.server.bean.AbstractTransactionManager<Transaction>
ru.bitel.bgbilling.modules.yoomoney.server.bean.TransactionManager

public class TransactionManager extends AbstractTransactionManager<Transaction>

- ## Field Summary

  ### Fields inherited from class ru.bitel.bgbilling.server.bean.AbstractTransactionManager

  `moduleSetup`

  ### Fields inherited from class ru.bitel.bgbilling.common.dao.AbstractDao

  `orderByPattern`

  ### Fields inherited from class ru.bitel.bgbilling.common.dao.AbstarctDaoConstant

  `con, ERROR, fields, moduleId, SQL_ALL, SQL_AND, SQL_CALC_FOUND_ROWS, SQL_DELETE, SQL_DISTINCT, SQL_EQ, SQL_EQCS, SQL_FROM, SQL_GROUP, SQL_IN, SQL_INSERT, SQL_JOIN, SQL_LEFT_JOIN, SQL_LIMIT, SQL_NOT_IN, SQL_ON, SQL_ON_DUPLICATE_KEY_UPDATE, SQL_ORDER, SQL_SELECT, SQL_SET, SQL_UPDATE, SQL_VALUES, SQL_WHERE, tableName`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TransactionManager(Connection con, int moduleId)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected void`
  `cancelAutopayment(int contractId)`
  `void`
  `carryOutPayment(Transaction transaction)`
  Deprecated.
  `protected void`
  `checkAutopayment(int contractId, org.json.JSONObject resultJsonObject)`
  `void`
  `deleteTransaction(int id)`
  Удаление платежа-транзакции из лога.
  `void`
  `doCheckRequest(String objectId)`
  `String`
  `doPaymentRequest(String data, String idempotenceKey)`
  `void`
  `doTransaction(String yoomoneyId, String status, BigDecimal sum, org.json.JSONObject resultJsonObject)`
  `String`
  `formatComment(String pattern, Transaction transaction)`
  Форматируем камент из шаблона.
  `List<String>`
  `getCheckIds(int intervalMinute)`
  `int`
  `getFirstYear(int contractId)`
  Возвращает год, с которого были платежи для этого договора.
  `protected Transaction`
  `getFromRS(ResultSet rs)`
  `protected <T extends BGAbstractTransaction>
  String`
  `getPaymentData(T transaction)`
  `org.json.JSONObject`
  `getPaymentRequestJSON(BigDecimal sum, int contractId, String contractTitle, String autoId, YoomoneyPaymentType paymentType)`
  `Transaction`
  `getTransactionByPaymentId(int paymentId)`
  `Transaction`
  `getTransactionByYoomoneyId(String yoomoneyId)`
  `Transaction`
  `getTransactionForInvoice(long invoiceId)`
  Возвращает транзакцию по ид_транзакции платёжной системы.
  `void`
  `searchTransactionList(SearchResult<Transaction> searchResult, SearchParam searchParam)`
  `protected void`
  `setConnectionTimeout(HttpsURLConnection connection)`
  `protected void`
  `updateImpl(Transaction transaction)`

  ### Methods inherited from class ru.bitel.bgbilling.server.bean.AbstractTransactionManager

  `checkColumn, doConnection, doConnection, executeQuerySumPage, getParameter, getParamString, getParamString, getParamString, getTransactionSumColumn, psSetId, psSetStatus, queryId, queryStatus, searchTransaction, setParameter`

  ### Methods inherited from class ru.bitel.bgbilling.common.dao.AbstractIdDao

  `delete, executeUpdate, get, getAndDelete, getAndUpdate, opt, prepareStatement, sqlCommand, sqlCommandAndTable, sqlQuery, sqlWhereId`

  ### Methods inherited from class ru.bitel.bgbilling.common.dao.AbstractDao

  `delete, deleteImpl, eq, get, getById, getImpl, getListFromRS, getPeriod, getQueryById, getSQLOrder, list, list, listImpl, listImpl, listImplPS, listImplPS, ormFromResultSet, ormUpdateImpl, ormUpdateImpl, ormUpdateImpl, ormUpdateImpl, psSetPeriod, queryPeriod, setStatementParam, update`

  ### Methods inherited from class ru.bitel.bgbilling.common.dao.AbstarctDaoConstant

  `getSQLOrder, getTableName, sqlLimit`

  ### Methods inherited from class ru.bitel.bgbilling.kernel.base.server.logger.BGLogger

  `error, error, error, getLogger, logError, logError`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### TransactionManager

    public TransactionManager(Connection con, int moduleId)

- ## Method Details

  - ### searchTransactionList

    public void searchTransactionList(SearchResult<Transaction> searchResult, SearchParam searchParam) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### getCheckIds

    public List<String> getCheckIds(int intervalMinute) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### getTransactionForInvoice

    public Transaction getTransactionForInvoice(long invoiceId) throws ru.bitel.bgbilling.common.BGException
    Возвращает транзакцию по ид_транзакции платёжной системы. Используется в экзекутере при проверке есть ли уже платёж с такой транзакцией у нас в БД, ибо может быть повторный запрос.
    Parameters:
      `invoiceId` - одноимённый параметр.
    Returns:
      объект транзакция.
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### getTransactionByYoomoneyId

    public Transaction getTransactionByYoomoneyId(String yoomoneyId) throws ru.bitel.bgbilling.common.BGException
    Parameters:
      `yoomoneyId` - - код( например 22e12f66-000f-5000-8000-18db351245c7 )
    Returns:
      транзакция
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### getTransactionByPaymentId

    public Transaction getTransactionByPaymentId(int paymentId) throws SQLException
    Throws:
      `SQLException`

  - ### getFirstYear

    public int getFirstYear(int contractId) throws SQLException
    Возвращает год, с которого были платежи для этого договора. Если не было ничего, то возвращает текущий.
    Parameters:
      `contractId` - контракт_ид
    Returns:
      четырёхзначное число - год
    Throws:
      `ru.bitel.bgbilling.common.BGException`
      `SQLException`

  - ### deleteTransaction

    public void deleteTransaction(int id) throws SQLException
    Удаление платежа-транзакции из лога. Не используется, кажется, пока.
    Parameters:
      `id` - ид платежа в таблице yoomoney_transactions_$mid.
    Throws:
      `ru.bitel.bgbilling.common.BGException`
      `SQLException`

  - ### carryOutPayment

    @Deprecated public void carryOutPayment(Transaction transaction) throws Exception
    Deprecated.
    Проведение платежа и занесение его в платежи договора.
    Parameters:
      `transaction` - транзакция, проверенная на нужность добавления
    Throws:
      `Exception`

  - ### formatComment

    public String formatComment(String pattern, Transaction transaction)
    Форматируем камент из шаблона. Комментарий расхода для нашего биллинга.
    Parameters:
      `pattern` - шаблон
      `transaction` - платёж-транзакция
    Returns:
      строка-камент

  - ### getFromRS

    protected Transaction getFromRS(ResultSet rs) throws SQLException
    Specified by:
      `getFromRS` in class `ru.bitel.bgbilling.common.dao.AbstractDao<Transaction>`
    Throws:
      `SQLException`

  - ### updateImpl

    protected void updateImpl(Transaction transaction) throws SQLException
    Specified by:
      `updateImpl` in class `ru.bitel.bgbilling.common.dao.AbstractDao<Transaction>`
    Throws:
      `SQLException`

  - ### setConnectionTimeout

    protected void setConnectionTimeout(HttpsURLConnection connection)
    Overrides:
      `setConnectionTimeout` in class `AbstractTransactionManager<Transaction>`

  - ### getPaymentRequestJSON

    public org.json.JSONObject getPaymentRequestJSON(BigDecimal sum, int contractId, String contractTitle, String autoId, YoomoneyPaymentType paymentType) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### doPaymentRequest

    public String doPaymentRequest(String data, String idempotenceKey)

  - ### doCheckRequest

    public void doCheckRequest(String objectId)

  - ### doTransaction

    public void doTransaction(String yoomoneyId, String status, BigDecimal sum, org.json.JSONObject resultJsonObject)

  - ### checkAutopayment

    protected void checkAutopayment(int contractId, org.json.JSONObject resultJsonObject)

  - ### cancelAutopayment

    protected void cancelAutopayment(int contractId)

  - ### getPaymentData

    protected <T extends BGAbstractTransaction> String getPaymentData(T transaction)
    Overrides:
      `getPaymentData` in class `AbstractTransactionManager<Transaction>`