fellowshipone 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/fellowshipone.gemspec +1 -1
- data/lib/fellowshipone/client.rb +4 -3
- data/lib/fellowshipone/resources/contribution.rb +10 -6
- data/lib/fellowshipone/resources/fund.rb +4 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c0f96aeb6efeb0ad266f5688754b2a51c5325bf
|
4
|
+
data.tar.gz: b09e7566537a80f57bc988171305a44090c35cb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22de87d9120ae904d5975a1c95720910bc55364b4137f5f9784d1220fd5185ce5d0dba700aa76094f84112fff25bfb26eb5fbdf5703f2229a57efbb9168579fb
|
7
|
+
data.tar.gz: ae6788414075775140dd841a9fa9cdeb2ea7108523f3235182bd4ec354288f909b3366d9793b46ef4786fef1162f23e4b8e8ea321bd8f6f41efe21cb9c4587fb
|
data/fellowshipone.gemspec
CHANGED
@@ -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.
|
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'
|
data/lib/fellowshipone/client.rb
CHANGED
@@ -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
|
-
|
26
|
-
|
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
|
|
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.
|
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:
|
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.
|
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/).
|