Sha256: fad9ba3d915a8f9265302a447d949f29d8135e35921827d099ab94f65c8b6fd7

Contents?: true

Size: 1.93 KB

Versions: 31

Compression:

Stored size: 1.93 KB

Contents

module RockRMS
  class Client
    module TransactionDetail
      def list_transaction_details(options = {})
        res = get(transaction_detail_path, options)
        Response::TransactionDetail.format(res)
      end

      def find_transaction_detail(id)
        res = get(transaction_detail_path(id))
        Response::TransactionDetail.format(res)
      end

      def update_transaction_detail(
        id,
        fund_id: nil,
        amount: nil,
        fee_amount: nil,
        fee_coverage_amount: nil,
        entity_type_id: nil,
        entity_id: nil
      )
        options = {}
        options['AccountId']         = fund_id        if fund_id
        options['Amount']            = amount         if amount
        options['FeeAmount']         = fee_amount     if fee_amount
        options['EntityTypeId']      = entity_type_id if entity_type_id
        options['EntityId']          = entity_id      if entity_id
        options['FeeCoverageAmount'] = fee_coverage_amount if fee_coverage_amount

        patch(transaction_detail_path(id), options)
      end

      def create_transaction_detail(
        transaction_id:,
        fund_id:,
        amount:,
        fee_amount: nil,
        fee_coverage_amount: nil,
        entity_type_id: nil,
        entity_id: nil
      )
        options = {}
        options['TransactionId']     = transaction_id
        options['AccountId']         = fund_id
        options['Amount']            = amount
        options['FeeAmount']         = fee_amount     if fee_amount
        options['EntityTypeId']      = entity_type_id if entity_type_id
        options['EntityId']          = entity_id      if entity_id
        options['FeeCoverageAmount'] = fee_coverage_amount if fee_coverage_amount

        post(transaction_detail_path, options)
      end

      private

      def transaction_detail_path(id = nil)
        id ? "FinancialTransactionDetails/#{id}" : 'FinancialTransactionDetails'
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
rock_rms-9.8.0 lib/rock_rms/resources/transaction_detail.rb
rock_rms-9.7.0 lib/rock_rms/resources/transaction_detail.rb
rock_rms-9.6.0 lib/rock_rms/resources/transaction_detail.rb
rock_rms-9.5.0 lib/rock_rms/resources/transaction_detail.rb
rock_rms-9.4.0 lib/rock_rms/resources/transaction_detail.rb
rock_rms-9.3.0 lib/rock_rms/resources/transaction_detail.rb
rock_rms-9.2.0 lib/rock_rms/resources/transaction_detail.rb
rock_rms-9.1.0 lib/rock_rms/resources/transaction_detail.rb
rock_rms-9.0.0 lib/rock_rms/resources/transaction_detail.rb
rock_rms-8.23.0 lib/rock_rms/resources/transaction_detail.rb
rock_rms-8.22.0 lib/rock_rms/resources/transaction_detail.rb
rock_rms-8.21.0 lib/rock_rms/resources/transaction_detail.rb
rock_rms-8.20.0 lib/rock_rms/resources/transaction_detail.rb
rock_rms-8.19.0 lib/rock_rms/resources/transaction_detail.rb
rock_rms-8.18.0 lib/rock_rms/resources/transaction_detail.rb
rock_rms-8.17.0 lib/rock_rms/resources/transaction_detail.rb
rock_rms-8.16.0 lib/rock_rms/resources/transaction_detail.rb
rock_rms-8.15.2 lib/rock_rms/resources/transaction_detail.rb
rock_rms-8.15.1 lib/rock_rms/resources/transaction_detail.rb
rock_rms-8.15.0 lib/rock_rms/resources/transaction_detail.rb