Sha256: a15f7c6c6e31bd414bceaee5651207ea47fabc48232abd838cc65b8822dfc127

Contents?: true

Size: 805 Bytes

Versions: 3

Compression:

Stored size: 805 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
                           :memo] 
    end
    
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fellowshipone-api-0.9.0 lib/writers/contribution_writer.rb
fellowshipone-api-0.8.0 lib/writers/contribution_writer.rb
fellowshipone-api-0.7.0 lib/writers/contribution_writer.rb