module Fellowshipone::Client::Contribution

Public Instance Methods

create_contribution(contribution_params) click to toggle source
# File lib/fellowshipone/resources/contribution.rb, line 13
def create_contribution(contribution_params)
  post("/giving/v1/contributionreceipts.json", contribution_params)
end
get_contribution(contribution_id) click to toggle source
# File lib/fellowshipone/resources/contribution.rb, line 5
def get_contribution(contribution_id)
  get("/giving/v1/contributionreceipts/#{contribution_id}.json")
end
new_contribution() click to toggle source
# File lib/fellowshipone/resources/contribution.rb, line 9
def new_contribution
  get("/giving/v1/contributionreceipts/new.json")
end
search_contributions(individual_id: nil, household_id: nil, start_date: nil, end_date: nil, page: 1) click to toggle source

startReceivedDate, endReceivedDate, page, individualID, householdID, recordsPerPage

# File lib/fellowshipone/resources/contribution.rb, line 22
def search_contributions(individual_id: nil, household_id: nil, start_date: nil, end_date: nil, page: 1)
  options = {recordsPerPage: 500}
  options.merge!(page: page)                    if page
  options.merge!(individualID: individual_id)   if individual_id
  options.merge!(householdID: household_id)     if household_id
  options.merge!(startReceivedDate: start_date) if start_date
  options.merge!(endReceivedDate: end_date)     if end_date

  params = Addressable::URI.form_encode(options)
  response = get("/giving/v1/contributionreceipts/search.json?#{params}").results
  Fellowshipone::Contribution.format(response)
end
update_contribution(contribution_id, contribution_params) click to toggle source
# File lib/fellowshipone/resources/contribution.rb, line 17
def update_contribution(contribution_id, contribution_params)
  put("/giving/v1/contributionreceipts/#{contribution_id}.json", contribution_params)
end