Sha256: d7a3ea131b24180c1d14b280975e131f1a8103672a698936b55adc6941b3f05c

Contents?: true

Size: 770 Bytes

Versions: 5

Compression:

Stored size: 770 Bytes

Contents

module FellowshipOne

  class ContributionWriter < ApiWriter

    # Constructor.
    #
    # @param data The json object data to save.
    def initialize(data)
      if data[:id]
        @url_action = :put
        @url_data_path = "/giving/v1/contributionreceipts/#{data[:id]}"
      else
        @url_action = :post
        @url_data_path = "/giving/v1/contributionreceipts"
      end
      @url_data_delete_path = "/giving/v1/contributionreceipts/#{data[:id]}"

      @url_data_params = @url_data_params = {:contributionReceipt => data}

      @updatable_fields = [:amount,
                           :fund,              #required
                           :received_date,     #required
                           :contribution_type] #required
    end
    
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fellowshipone-api-0.6.4 lib/writers/contribution_writer.rb
fellowshipone-api-0.6.3 lib/writers/contribution_writer.rb
fellowshipone-api-0.6.2 lib/writers/contribution_writer.rb
fellowshipone-api-0.6.1 lib/writers/contribution_writer.rb
fellowshipone-api-0.6.0 lib/writers/contribution_writer.rb