Sha256: d39a4a7bdf7dbe383d2ef158b0dd1581bf4b91f35126d887c5ffad69b3a492f0

Contents?: true

Size: 799 Bytes

Versions: 3

Compression:

Stored size: 799 Bytes

Contents

module PensioAPI
  class FundingList
    attr_reader :filename
    attr_reader :amount
    attr_reader :acquirer
    attr_reader :funding_date
    attr_reader :created_at
    attr_reader :download_link

    def self.all(options={})
      request = Request.new('/merchant/API/fundingList', options)
      Responses::FundingList.new(request)
    end

    def initialize(funding_list_body)
      @raw = funding_list_body

      @filename = @raw['Filename']
      @amount = @raw['Amount']
      @acquirer = @raw['Acquirer']
      @funding_date = Date.parse(@raw['FundingDate'])
      @created_at = Date.parse(@raw['CreatedDate'])
      @download_link = @raw['DownloadLink']
    end

    def download(options={})
      @result ||= FundingListRequest.new(@download_link, options).result
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pensio_api-0.3.3 lib/pensio_api/funding_list.rb
pensio_api-0.3.2 lib/pensio_api/funding_list.rb
pensio_api-0.3.1 lib/pensio_api/funding_list.rb