Sha256: 4ac1a6ab563eb71b2a840cd4838d5ea7b702ab6629f085338efdaaa9e2a523b6

Contents?: true

Size: 1.61 KB

Versions: 30

Compression:

Stored size: 1.61 KB

Contents

module FinApps
  module REST

    class Transactions < FinApps::REST::Resources
      include FinApps::REST::Defaults

      # @transaction_id [String]
      # # @return [Hash, Array<String>]
      def show(transaction_id)
        logger.debug "##{__method__.to_s} => Started"

        end_point = Defaults::END_POINTS[:transactions_show]
        logger.debug "##{__method__.to_s} => end_point: #{end_point}"

        path = end_point.sub ':transaction_id', ERB::Util.url_encode(transaction_id)
        logger.debug "##{__method__.to_s} => path: #{path}"

        transaction, error_messages =  @client.send(path, :get)

        logger.debug "##{__method__.to_s} => Completed"
        return transaction, error_messages
      end


      # @param [Hash] params
      # @return [Array<Hash>, Array<String>]
      def search(params={})
        logger.debug "##{__method__.to_s} => Started"

        path = Defaults::END_POINTS[:transactions_list]
        logger.debug "##{__method__.to_s} => path: #{path}"

        transactions, error_messages = @client.send(path, :post, params.compact)

        logger.debug "##{__method__.to_s} => Completed"
        return transactions, error_messages
      end

      # @param [Hash] params
      # @return [Array<Hash>, Array<String>]
      def update(params={})
        logger.debug "##{__method__.to_s} => Started"

        path = Defaults::END_POINTS[:transactions_update]
        logger.debug "##{__method__.to_s} => path: #{path}"

        _, error_messages = @client.send(path, :put, params.compact)

        logger.debug "##{__method__.to_s} => Completed"
        error_messages
      end

    end

  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
finapps-0.17.0.pre lib/finapps/rest/transactions.rb
finapps-0.16.6.pre lib/finapps/rest/transactions.rb
finapps-0.16.5.pre lib/finapps/rest/transactions.rb
finapps-0.16.4.pre lib/finapps/rest/transactions.rb
finapps-0.16.3.pre lib/finapps/rest/transactions.rb
finapps-0.16.2.pre lib/finapps/rest/transactions.rb
finapps-0.16.1.pre lib/finapps/rest/transactions.rb
finapps-0.16.0.pre lib/finapps/rest/transactions.rb
finapps-0.15.2.pre lib/finapps/rest/transactions.rb
finapps-0.15.1.pre lib/finapps/rest/transactions.rb
finapps-0.15.0.pre lib/finapps/rest/transactions.rb
finapps-0.14.5.pre lib/finapps/rest/transactions.rb
finapps-0.14.3.pre lib/finapps/rest/transactions.rb
finapps-0.14.2.pre lib/finapps/rest/transactions.rb
finapps-0.14.1.pre lib/finapps/rest/transactions.rb
finapps-0.14.0.pre lib/finapps/rest/transactions.rb
finapps-0.13.1.pre lib/finapps/rest/transactions.rb
finapps-0.13.0.pre lib/finapps/rest/transactions.rb
finapps-0.12.5.pre lib/finapps/rest/transactions.rb
finapps-0.12.4.pre lib/finapps/rest/transactions.rb