group DirectTransactionSqlDao: EntitySqlDao;
tableName() ::= "direct_transactions"
historyTableName() ::= "direct_transaction_history"
defaultOrderBy(prefix) ::= <<
order by <prefix>effective_date ASC, <recordIdField(prefix)> ASC
>>
tableFields(prefix) ::= <<
<prefix>transaction_external_key
, <prefix>transaction_type
, <prefix>effective_date
, <prefix>payment_status
, <prefix>amount
, <prefix>currency
, <prefix>processed_amount
, <prefix>processed_currency
, <prefix>direct_payment_id
, <prefix>gateway_error_code
, <prefix>gateway_error_msg
, <prefix>created_by
, <prefix>created_date
, <prefix>updated_by
, <prefix>updated_date
>>
tableValues() ::= <<
:transactionExternalKey
, :transactionType
, :effectiveDate
, :paymentStatus
, :amount
, :currency
, :processedAmount
, :processedCurrency
, :directPaymentId
, :gatewayErrorCode
, :gatewayErrorMsg
, :createdBy
, :createdDate
, :updatedBy
, :updatedDate
>>
getDirectPaymentTransactionByExternalKey() ::= <<
select
<allTableFields("")>
from <tableName()>
where transaction_external_key = :transactionExternalKey
;
>>
updateTransactionStatus() ::= <<
update <tableName()>
set payment_status = :paymentStatus
, processed_amount = :processedAmount
, processed_currency = :processedCurrency
, gateway_error_code = :gatewayErrorCode
, gateway_error_msg = :gatewayErrorMsg
, updated_by = :updatedBy
, updated_date = :createdDate
where id = :id
<AND_CHECK_TENANT()>
;
>>
getByDirectPaymentId() ::= <<
select <allTableFields()>
from <tableName()>
where direct_payment_id = :directPaymentId
<AND_CHECK_TENANT()>
<defaultOrderBy()>
;
>>