rock_rms 5.0.0 → 5.1.0
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/lib/rock_rms/client.rb +1 -0
- data/lib/rock_rms/resources/recurring_donation_detail.rb +19 -0
- data/lib/rock_rms/response/recurring_donation_details.rb +2 -1
- data/lib/rock_rms/version.rb +1 -1
- data/spec/rock_rms/resources/recurring_donation_detail_spec.rb +29 -0
- data/spec/rock_rms/resources/recurring_donation_spec.rb +1 -1
- data/spec/support/rock_mock.rb +2 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cdeba8c6445c28a97f6ae95e91b65731de96d4b
|
4
|
+
data.tar.gz: 8c6fd406588607a4c3f445f89c27a023ef3f78d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e87c92795588370db7d42df6ced5654be5c365a457df0e1a343ee80e1e79e5605203977ad2e160725097e10b7c2543cf5f58e3371b6b6b51fb3b64e0149fd9af
|
7
|
+
data.tar.gz: 818a07c9b3fa588175a9ad62c686e5c08342dc3971d2ff62b6a3b178ae566a55b715fe1b935582a738cd185dd6ee274e1896e09de6d421da17bb7bd4235ade8c
|
data/lib/rock_rms/client.rb
CHANGED
@@ -27,6 +27,7 @@ module RockRMS
|
|
27
27
|
include RockRMS::Client::Person
|
28
28
|
include RockRMS::Client::PhoneNumber
|
29
29
|
include RockRMS::Client::RecurringDonation
|
30
|
+
include RockRMS::Client::RecurringDonationDetail
|
30
31
|
include RockRMS::Client::Refund
|
31
32
|
include RockRMS::Client::RefundReason
|
32
33
|
include RockRMS::Client::SavedPaymentMethod
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module RockRMS
|
2
|
+
class Client
|
3
|
+
module RecurringDonationDetail
|
4
|
+
def update_recurring_donation_detail(id, fund_id: nil, amount: nil)
|
5
|
+
options = {}
|
6
|
+
options['AccountId'] = fund_id if fund_id
|
7
|
+
options['Amount'] = amount if amount
|
8
|
+
|
9
|
+
patch(recurring_donation_detail_path(id), options)
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def recurring_donation_detail_path(id = nil)
|
15
|
+
id ? "FinancialScheduledTransactionDetails/#{id}" : 'FinancialScheduledTransactionDetails'
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/rock_rms/version.rb
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe RockRMS::Client::RecurringDonationDetail, type: :model do
|
4
|
+
include_context 'resource specs'
|
5
|
+
|
6
|
+
describe '#update_recurring_donation_detail' do
|
7
|
+
subject(:resource) do
|
8
|
+
client.update_recurring_donation_detail(
|
9
|
+
123,
|
10
|
+
fund_id: 2,
|
11
|
+
amount: 100.0
|
12
|
+
)
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'returns nothing' do
|
16
|
+
expect(client.update_recurring_donation_detail(123, fund_id: 5, amount: 100.0)).to eq(nil)
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'passes options' do
|
20
|
+
expect(client).to receive(:patch)
|
21
|
+
.with(
|
22
|
+
'FinancialScheduledTransactionDetails/123',
|
23
|
+
'AccountId' => 2,
|
24
|
+
'Amount' => 100.0
|
25
|
+
).and_call_original
|
26
|
+
resource
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -49,7 +49,7 @@ RSpec.describe RockRMS::Client::RecurringDonation, type: :model do
|
|
49
49
|
end
|
50
50
|
|
51
51
|
describe '#update_recurring_donation(id)' do
|
52
|
-
it '
|
52
|
+
it 'updates the recurring donation' do
|
53
53
|
expect(client).to receive(:patch)
|
54
54
|
.with(
|
55
55
|
'FinancialScheduledTransactions/123',
|
data/spec/support/rock_mock.rb
CHANGED
@@ -76,7 +76,8 @@ class RockMock < Sinatra::Base
|
|
76
76
|
'FinancialBatches/:id',
|
77
77
|
'FinancialScheduledTransactions/:id',
|
78
78
|
'FinancialTransactions/:id',
|
79
|
-
'FinancialTransactionDetails/:id'
|
79
|
+
'FinancialTransactionDetails/:id',
|
80
|
+
'FinancialScheduledTransactionDetails/:id',
|
80
81
|
].each do |end_point|
|
81
82
|
patch "/api/#{end_point}" do
|
82
83
|
content_type :json
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rock_rms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taylor Brooks
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -202,6 +202,7 @@ files:
|
|
202
202
|
- lib/rock_rms/resources/person.rb
|
203
203
|
- lib/rock_rms/resources/phone_number.rb
|
204
204
|
- lib/rock_rms/resources/recurring_donation.rb
|
205
|
+
- lib/rock_rms/resources/recurring_donation_detail.rb
|
205
206
|
- lib/rock_rms/resources/refund.rb
|
206
207
|
- lib/rock_rms/resources/refund_reason.rb
|
207
208
|
- lib/rock_rms/resources/saved_payment_method.rb
|
@@ -253,6 +254,7 @@ files:
|
|
253
254
|
- spec/rock_rms/resources/payment_detail_spec.rb
|
254
255
|
- spec/rock_rms/resources/person_spec.rb
|
255
256
|
- spec/rock_rms/resources/phone_number_spec.rb
|
257
|
+
- spec/rock_rms/resources/recurring_donation_detail_spec.rb
|
256
258
|
- spec/rock_rms/resources/recurring_donation_spec.rb
|
257
259
|
- spec/rock_rms/resources/refund_reason_spec.rb
|
258
260
|
- spec/rock_rms/resources/refund_spec.rb
|