Module: UU::Fairpay2::FinancialTransaction::BankTransaction
- Extended by:
- BankTransaction
- Included in:
- BankTransaction
- Defined in:
- lib/uu/fairpay2/bank_transaction.rb
Overview
Module Bank Transaction. This service allows managing bank transactions, withdrawals and deposits at Client Account Business Case(CABC).
Constant Summary
- PATH =
Service path
'uu/fairpay2/financialtransaction/BankTransaction'
Instance Method Summary (collapse)
-
- (UU::OS::UESURI) create(credit_business_case_uri, bank_transaction = nil)
Creates new Bank Transaction.
-
- (Object) get_attributes(bank_transaction_uri)
Obtains Bank Transaction attributes from REST service and returns them.
-
- (UU::OS::REST::ResultList<UU::Fairpay2::FinancialTransaction::BankTransactionGetTransactionList, UU::Fairpay2::FinancialTransaction::BankTransactionAttributes>) get_transaction_list(client_business_case_uri, criteria = nil)
Retrieves a result list of financial transaction for specified client account business case by UESURI.
-
- (UU::OS::UESURI) set_attributes(bank_transaction_uri, bank_transaction = nil)
Set selected attributes to existing Bank Transaction with passed DTO parameters.
Instance Method Details
- (UU::OS::UESURI) create(credit_business_case_uri, bank_transaction = nil)
Creates new Bank Transaction. The command creates a new Bank Transaction on specified Business Case with passed DTO parameters.
Financial transaction types:
bank transaction,
deposit, withdrawal. Transaction type is specified by
meta_artifact_uri
attribute.
Required attributes:
name, meta_artifact_uri, competent_role_uri, location_uri, amount, debit_business_case_uri, currency, credit_account_currency, debit_account_currency, exchange_rate_for_opp_side, amount_for_opp_side
133 134 135 136 137 138 139 140 141 |
# File 'lib/uu/fairpay2/bank_transaction.rb', line 133 def create(credit_business_case_uri, bank_transaction = nil) svc = UU::OS::REST::RemoteClient.new(BankTransaction) bank_transaction_create = UU::Fairpay2::FinancialTransaction::BankTransactionCreate.new(bank_transaction).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('create', credit_business_case_uri, bank_transaction_create) return UU::OS::UESURI.new(res) end end |
- (Object) get_attributes(bank_transaction_uri)
Obtains Bank Transaction attributes from REST service and returns them
200 201 202 203 204 205 206 |
# File 'lib/uu/fairpay2/bank_transaction.rb', line 200 def get_attributes(bank_transaction_uri) svc = UU::OS::REST::RemoteClient.new(BankTransaction) UU::OS::QoS::QoSHandler.auto_retry do attrs = svc.get('getAttributes', bank_transaction_uri) return UU::Fairpay2::FinancialTransaction::BankTransactionAttributes.new(attrs) end end |
- (UU::OS::REST::ResultList<UU::Fairpay2::FinancialTransaction::BankTransactionGetTransactionList, UU::Fairpay2::FinancialTransaction::BankTransactionAttributes>) get_transaction_list(client_business_case_uri, criteria = nil)
Retrieves a result list of financial transaction for specified client account business case by UESURI. The resulting attachment list is filtered according to the criteria provided by the criteria attribute.
225 226 227 228 229 230 231 232 233 234 235 |
# File 'lib/uu/fairpay2/bank_transaction.rb', line 225 def get_transaction_list(client_business_case_uri, criteria = nil) svc = UU::OS::REST::RemoteClient.new(BankTransaction) dto = UU::Fairpay2::FinancialTransaction::BankTransactionGetTransactionList.new(criteria) svc.add_parameter('pageIndex', dto.page_index) svc.add_parameter('pageSize', dto.page_size) svc.add_parameter('query', dto.query) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getTransactionList', client_business_case_uri) return UU::OS::REST::ResultList.new(UU::Fairpay2::FinancialTransaction::BankTransactionGetTransactionList, UU::Fairpay2::FinancialTransaction::BankTransactionAttributes, res) end end |
- (UU::OS::UESURI) set_attributes(bank_transaction_uri, bank_transaction = nil)
Set selected attributes to existing Bank Transaction with passed DTO parameters.
178 179 180 181 182 183 184 185 |
# File 'lib/uu/fairpay2/bank_transaction.rb', line 178 def set_attributes(bank_transaction_uri, bank_transaction = nil) svc = UU::OS::REST::RemoteClient.new(BankTransaction) bank_transaction_set = UU::Fairpay2::FinancialTransaction::BankTransactionSetAttributes.new(bank_transaction).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('setAttributes', bank_transaction_uri, bank_transaction_set) return UU::OS::UESURI.new(res) end end |