fellowshipone 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fd29d0d0363d1edd4025491ddfc00e822d902c32
4
- data.tar.gz: 7c9e36f83e593af1cd0d2cf9043b68372f4e2541
3
+ metadata.gz: 0c0f96aeb6efeb0ad266f5688754b2a51c5325bf
4
+ data.tar.gz: b09e7566537a80f57bc988171305a44090c35cb9
5
5
  SHA512:
6
- metadata.gz: 41412330c336785778eb9b7b54687d2159618f1652759afe0af37ef584093353770eb4bddcbfeac1fab503824a0e387744ddab45f5834460521f6275db8474a2
7
- data.tar.gz: d9a50d2b17bf20c35325b101794edf2f9509a939773a74cd65563a5bafbd3d1f4aea9b62f8a3832a987e2fecff8b47ac03162d1a714ace98a487624231bd10d0
6
+ metadata.gz: 22de87d9120ae904d5975a1c95720910bc55364b4137f5f9784d1220fd5185ce5d0dba700aa76094f84112fff25bfb26eb5fbdf5703f2229a57efbb9168579fb
7
+ data.tar.gz: ae6788414075775140dd841a9fa9cdeb2ea7108523f3235182bd4ec354288f909b3366d9793b46ef4786fef1162f23e4b8e8ea321bd8f6f41efe21cb9c4587fb
@@ -2,7 +2,7 @@ $:.push File.expand_path("../lib", __FILE__)
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'fellowshipone'
5
- s.version = '1.3.0'
5
+ s.version = '1.3.1'
6
6
  s.authors = ['Taylor Brooks']
7
7
  s.email = ['tbrooks@gmail.com']
8
8
  s.homepage = 'https://github.com/taylorbrooks/fellowshipone'
@@ -14,14 +14,15 @@ module Fellowshipone
14
14
  include Fellowshipone::Client::Person
15
15
  include Fellowshipone::Client::PledgeDrive
16
16
 
17
- attr_reader :church_code, :consumer_key, :consumer_secret, :token, :secret
17
+ attr_reader :church_code, :consumer_key, :consumer_secret, :token, :secret, logger
18
18
 
19
- def initialize(church_code, consumer_key, consumer_secret, token, secret)
19
+ def initialize(church_code, consumer_key, consumer_secret, token, secret, logger = false)
20
20
  @church_code = church_code
21
21
  @consumer_key = consumer_key
22
22
  @consumer_secret = consumer_secret
23
23
  @token = token
24
24
  @secret = secret
25
+ @logger = logger
25
26
  end
26
27
 
27
28
  def get(path, options={})
@@ -62,7 +63,7 @@ module Fellowshipone
62
63
  Faraday.new(url: "https://#{church_code}.fellowshiponeapi.com", headers: { accept: 'application/json' }) do |connection|
63
64
  connection.request :json
64
65
  connection.request :oauth, oauth_data
65
- connection.response :logger
66
+ connection.response :logger if logger
66
67
  connection.use FaradayMiddleware::Mashify
67
68
  connection.response :json
68
69
  connection.adapter Faraday.default_adapter
@@ -2,10 +2,6 @@ module Fellowshipone
2
2
  class Client
3
3
  module Contribution
4
4
 
5
- def contributions
6
-
7
- end
8
-
9
5
  def get_contribution(contribution_id)
10
6
  get("/giving/v1/contributionreceipts/#{contribution_id}.json")
11
7
  end
@@ -22,8 +18,16 @@ module Fellowshipone
22
18
  put("/giving/v1/contributionreceipts/#{contribution_id}.json", contribution_params)
23
19
  end
24
20
 
25
- def search_contributions( params = {} )
26
- params = Addressable::URI.form_encode(params)
21
+ # startReceivedDate, endReceivedDate, page, individualID, householdID, recordsPerPage
22
+ def search_contributions(person_id: nil, household_id: nil, start_date: nil, end_date: nil, page: 1)
23
+ options = {recordsPerPage: 500}
24
+ options.merge!(page: page) if page
25
+ options.merge!(individualID: individual_id) if individual_id
26
+ options.merge!(householdID: household_id) if household_id
27
+ options.merge!(startReceivedDate: start_date) if start_date
28
+ options.merge!(endReceivedDate: end_date) if end_date
29
+
30
+ params = Addressable::URI.form_encode(options)
27
31
  get("/giving/v1/contributionreceipts/search.json?#{params}")
28
32
  end
29
33
 
@@ -10,6 +10,10 @@ module Fellowshipone
10
10
  get("/giving/v1/fund/#{id}.json")
11
11
  end
12
12
 
13
+ def subfunds(fund_id)
14
+ get("/giving/v1/funds/#{fund_id}/subfunds")
15
+ end
16
+
13
17
  end
14
18
  end
15
19
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fellowshipone
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Brooks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-10 00:00:00.000000000 Z
11
+ date: 2016-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -209,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
209
209
  version: '0'
210
210
  requirements: []
211
211
  rubyforge_project:
212
- rubygems_version: 2.4.5
212
+ rubygems_version: 2.5.1
213
213
  signing_key:
214
214
  specification_version: 4
215
215
  summary: Ruby gem/plugin to interact with the FellowshipOne API (https://developer.fellowshipone.com/).