rock_rms 6.2.0 → 7.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rock_rms/version.rb +1 -1
- data/rock_rms.gemspec +2 -2
- data/spec/rock_rms/client_spec.rb +2 -2
- data/spec/rock_rms/resources/attribute_spec.rb +13 -11
- data/spec/rock_rms/resources/attribute_values_spec.rb +6 -4
- data/spec/rock_rms/resources/batch_spec.rb +12 -8
- data/spec/rock_rms/resources/group_spec.rb +2 -2
- data/spec/rock_rms/resources/payment_detail_spec.rb +5 -3
- data/spec/rock_rms/resources/phone_number_spec.rb +8 -6
- data/spec/rock_rms/resources/recurring_donation_detail_spec.rb +9 -5
- data/spec/rock_rms/resources/recurring_donation_spec.rb +17 -13
- data/spec/rock_rms/resources/refund_reason_spec.rb +8 -6
- data/spec/rock_rms/resources/refund_spec.rb +52 -49
- data/spec/rock_rms/resources/saved_payment_method_spec.rb +8 -6
- data/spec/rock_rms/resources/transaction_detail_spec.rb +8 -4
- data/spec/rock_rms/resources/transaction_spec.rb +19 -15
- data/spec/support/client_factory.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbf6c404818d64db447dec9684bf68e4ecbf8410bf0eb56e415e29cb871acf95
|
4
|
+
data.tar.gz: 15a858db3f54c8075c8b49797ce98ac563068657d9646037a7002080a122a8c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9475d6bdb74146d458dd4ec30806823f9218c971eba9515b49897791e9faf5f93305fd84ab182f6c9f5d38fc56ee0c2b9b24a5fcaee1407c6fff9f8aca58f4a3
|
7
|
+
data.tar.gz: 4b4b766e497632de3a72c3122929e51db8b87ae6906ae18c3a486b4b91e07245e513d3dd2d6f3f0b933860e916e20241e3bfd1f575f24b628e7c11b9e092fc9d
|
data/lib/rock_rms/version.rb
CHANGED
data/rock_rms.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.executables = s.files.grep(%r{^bin/}).map { |f| File.basename(f) }
|
17
17
|
s.test_files = s.files.grep(%r{^(test)/})
|
18
18
|
|
19
|
-
s.required_ruby_version = '~> 2.
|
19
|
+
s.required_ruby_version = '~> 2.7'
|
20
20
|
|
21
21
|
s.require_paths = ['lib']
|
22
22
|
|
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
|
|
25
25
|
s.add_runtime_dependency 'faraday_middleware-parse_oj'
|
26
26
|
s.add_runtime_dependency 'json'
|
27
27
|
|
28
|
-
s.add_development_dependency 'bundler', '~> 2.
|
28
|
+
s.add_development_dependency 'bundler', '~> 2.3'
|
29
29
|
s.add_development_dependency 'dotenv'
|
30
30
|
s.add_development_dependency 'pry'
|
31
31
|
s.add_development_dependency 'rake', '~> 12.3.3'
|
@@ -10,8 +10,8 @@ RSpec.describe RockRMS::Client do
|
|
10
10
|
end
|
11
11
|
let(:attrs_without_logging) { attrs.merge(logger: false) }
|
12
12
|
|
13
|
-
subject(:client) { described_class.new(attrs_without_logging) }
|
14
|
-
let(:noisy_client) { described_class.new(attrs) }
|
13
|
+
subject(:client) { described_class.new(**attrs_without_logging) }
|
14
|
+
let(:noisy_client) { described_class.new(**attrs) }
|
15
15
|
|
16
16
|
describe '#initialize' do
|
17
17
|
it 'requries `url` param' do
|
@@ -53,17 +53,19 @@ RSpec.describe RockRMS::Client::Attribute, type: :model do
|
|
53
53
|
expect(client).to receive(:post)
|
54
54
|
.with(
|
55
55
|
'Attributes',
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
56
|
+
{
|
57
|
+
'FieldTypeId' => 14,
|
58
|
+
'EntityTypeId' => 85,
|
59
|
+
'Key' => 'TransactionFee',
|
60
|
+
'Name' => 'Transaction Fee',
|
61
|
+
'Description' => 'Transaction fees for a specific gateway',
|
62
|
+
'Order' => 1234,
|
63
|
+
'IsSystem' => false,
|
64
|
+
'IsGridColumn' => false,
|
65
|
+
'IsMultiValue' => false,
|
66
|
+
'IsRequired' => false,
|
67
|
+
'AllowSearch' => false
|
68
|
+
}
|
67
69
|
)
|
68
70
|
.and_call_original
|
69
71
|
resource
|
@@ -45,10 +45,12 @@ RSpec.describe RockRMS::Client::AttributeValue, type: :model do
|
|
45
45
|
expect(client).to receive(:post)
|
46
46
|
.with(
|
47
47
|
'AttributeValues',
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
48
|
+
{
|
49
|
+
'AttributeId' => 12993,
|
50
|
+
'EntityId' => 731,
|
51
|
+
'Value' => 100,
|
52
|
+
'IsSystem' => false
|
53
|
+
}
|
52
54
|
)
|
53
55
|
.and_call_original
|
54
56
|
resource
|
@@ -69,12 +69,14 @@ RSpec.describe RockRMS::Client::Batch, type: :model do
|
|
69
69
|
expect(client).to receive(:post)
|
70
70
|
.with(
|
71
71
|
'FinancialBatches',
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
72
|
+
{
|
73
|
+
'Name' => '1',
|
74
|
+
'CampusId' => 1,
|
75
|
+
'BatchStartDateTime' => '1',
|
76
|
+
'BatchEndDateTime' => '1',
|
77
|
+
'ForeignKey' => 1,
|
78
|
+
'Status' => 1
|
79
|
+
}
|
78
80
|
).and_call_original
|
79
81
|
resource
|
80
82
|
end
|
@@ -97,8 +99,10 @@ RSpec.describe RockRMS::Client::Batch, type: :model do
|
|
97
99
|
expect(client).to receive(:patch)
|
98
100
|
.with(
|
99
101
|
'FinancialBatches/123',
|
100
|
-
|
101
|
-
|
102
|
+
{
|
103
|
+
'Name' => '1',
|
104
|
+
'ForeignKey' => 1
|
105
|
+
}
|
102
106
|
).and_call_original
|
103
107
|
resource
|
104
108
|
end
|
@@ -38,7 +38,7 @@ RSpec.describe RockRMS::Client::Group, type: :model do
|
|
38
38
|
|
39
39
|
it 'passes options' do
|
40
40
|
expect(client).to receive(:get)
|
41
|
-
.with('Groups', option1: '1')
|
41
|
+
.with('Groups', { option1: '1' })
|
42
42
|
.and_return([])
|
43
43
|
client.list_groups(option1: '1')
|
44
44
|
end
|
@@ -95,7 +95,7 @@ RSpec.describe RockRMS::Client::Group, type: :model do
|
|
95
95
|
|
96
96
|
it 'passes options' do
|
97
97
|
expect(client).to receive(:get)
|
98
|
-
.with('Groups/GetFamilies/123', option1: '1')
|
98
|
+
.with('Groups/GetFamilies/123', { option1: '1' })
|
99
99
|
.and_return([])
|
100
100
|
client.list_families_for_person(123, option1: '1')
|
101
101
|
end
|
@@ -31,9 +31,11 @@ RSpec.describe RockRMS::Client::PaymentDetail, type: :model do
|
|
31
31
|
expect(client).to receive(:post)
|
32
32
|
.with(
|
33
33
|
'FinancialPaymentDetails',
|
34
|
-
|
35
|
-
|
36
|
-
|
34
|
+
{
|
35
|
+
'CurrencyTypeValueId' => 156,
|
36
|
+
'CreditCardTypeValueId' => 159,
|
37
|
+
'ForeignKey' => nil
|
38
|
+
}
|
37
39
|
)
|
38
40
|
.and_call_original
|
39
41
|
resource
|
@@ -36,11 +36,13 @@ RSpec.describe RockRMS::Client::PhoneNumber, type: :model do
|
|
36
36
|
expect(client).to receive(:post)
|
37
37
|
.with(
|
38
38
|
'PhoneNumbers',
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
39
|
+
{
|
40
|
+
'IsSystem' => true,
|
41
|
+
'IsMessagingEnabled' => false,
|
42
|
+
'NumberTypeValueId' => 13,
|
43
|
+
'Number' => '5555555555',
|
44
|
+
'PersonId' => 1
|
45
|
+
}
|
44
46
|
).and_call_original
|
45
47
|
resource
|
46
48
|
end
|
@@ -61,7 +63,7 @@ RSpec.describe RockRMS::Client::PhoneNumber, type: :model do
|
|
61
63
|
|
62
64
|
it 'passes options' do
|
63
65
|
expect(client).to receive(:get)
|
64
|
-
.with('PhoneNumbers', option1: '1')
|
66
|
+
.with('PhoneNumbers', { option1: '1' })
|
65
67
|
.and_return([])
|
66
68
|
client.list_phone_numbers(option1: '1')
|
67
69
|
end
|
@@ -38,9 +38,11 @@ RSpec.describe RockRMS::Client::RecurringDonationDetail, type: :model do
|
|
38
38
|
expect(client).to receive(:post)
|
39
39
|
.with(
|
40
40
|
'FinancialScheduledTransactionDetails',
|
41
|
-
|
42
|
-
|
43
|
-
|
41
|
+
{
|
42
|
+
'AccountId' => 1,
|
43
|
+
'ScheduledTransactionId' => 1,
|
44
|
+
'Amount' => 5.00,
|
45
|
+
}
|
44
46
|
)
|
45
47
|
.and_call_original
|
46
48
|
resource
|
@@ -64,8 +66,10 @@ RSpec.describe RockRMS::Client::RecurringDonationDetail, type: :model do
|
|
64
66
|
expect(client).to receive(:patch)
|
65
67
|
.with(
|
66
68
|
'FinancialScheduledTransactionDetails/123',
|
67
|
-
|
68
|
-
|
69
|
+
{
|
70
|
+
'AccountId' => 2,
|
71
|
+
'Amount' => 100.0
|
72
|
+
}
|
69
73
|
).and_call_original
|
70
74
|
resource
|
71
75
|
end
|
@@ -53,7 +53,9 @@ RSpec.describe RockRMS::Client::RecurringDonation, type: :model do
|
|
53
53
|
expect(client).to receive(:patch)
|
54
54
|
.with(
|
55
55
|
'FinancialScheduledTransactions/123',
|
56
|
-
|
56
|
+
{
|
57
|
+
'NextPaymentDate' => '2018-01-01'
|
58
|
+
}
|
57
59
|
).and_call_original
|
58
60
|
|
59
61
|
resource = client.update_recurring_donation(
|
@@ -131,18 +133,20 @@ RSpec.describe RockRMS::Client::RecurringDonation, type: :model do
|
|
131
133
|
expect(client).to receive(:post)
|
132
134
|
.with(
|
133
135
|
'FinancialScheduledTransactions',
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
136
|
+
{
|
137
|
+
'AuthorizedPersonAliasId' => 1,
|
138
|
+
'TransactionFrequencyValueId' => 135,
|
139
|
+
'StartDate' => '2010-01-01',
|
140
|
+
'NextPaymentDate' => '2010-01-01',
|
141
|
+
'IsActive' => true,
|
142
|
+
'FinancialGatewayId' => nil,
|
143
|
+
'FinancialPaymentDetailId' => nil,
|
144
|
+
'TransactionCode' => 'asdf',
|
145
|
+
'ScheduledTransactionDetails' => [{ 'Amount' => 450, 'AccountId' => 2, 'EntityId' => nil, 'EntityTypeId' => nil, 'FeeAmount' => nil, 'FeeCoverageAmount' => nil}],
|
146
|
+
'GatewayScheduleId' => nil,
|
147
|
+
'SourceTypeValueId' => 10,
|
148
|
+
'ForeignKey' => nil
|
149
|
+
}
|
146
150
|
)
|
147
151
|
.and_call_original
|
148
152
|
resource
|
@@ -42,12 +42,14 @@ RSpec.describe RockRMS::Client::RefundReason, type: :model do
|
|
42
42
|
expect(client).to receive(:post)
|
43
43
|
.with(
|
44
44
|
'DefinedValues',
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
45
|
+
{
|
46
|
+
'DefinedTypeId' => 37,
|
47
|
+
'IsSystem' => false,
|
48
|
+
'Order' => 500,
|
49
|
+
'Description' => "Very Very not Happy",
|
50
|
+
'Value' => "Angry Donor",
|
51
|
+
'IsActive' => false
|
52
|
+
}
|
51
53
|
)
|
52
54
|
.and_call_original
|
53
55
|
resource
|
@@ -46,30 +46,32 @@ RSpec.describe RockRMS::Client::Refund, type: :model do
|
|
46
46
|
expect(client).to receive(:post)
|
47
47
|
.with(
|
48
48
|
'FinancialTransactionRefunds',
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
'
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
49
|
+
{
|
50
|
+
'OriginalTransactionId' => 3000,
|
51
|
+
'RefundReasonValueId' => 1,
|
52
|
+
'FinancialTransaction' => {
|
53
|
+
'AuthorizedPersonAliasId' => 120,
|
54
|
+
'BatchId' => 1,
|
55
|
+
'FinancialGatewayId' => nil,
|
56
|
+
'FinancialPaymentDetailId' => 156,
|
57
|
+
'TransactionDateTime' => '2018-02-01',
|
58
|
+
'TransactionDetails' => [
|
59
|
+
{
|
60
|
+
"Amount"=>-10.0,
|
61
|
+
"AccountId"=>23,
|
62
|
+
"EntityTypeId" => nil,
|
63
|
+
"EntityId" => nil
|
64
|
+
},
|
65
|
+
{
|
66
|
+
"Amount"=> -90.0,
|
67
|
+
"AccountId"=>24,
|
68
|
+
"EntityTypeId" => nil,
|
69
|
+
"EntityId" => nil
|
70
|
+
}
|
71
|
+
],
|
72
|
+
'TransactionTypeValueId' => 53,
|
73
|
+
'TransactionCode' => nil
|
74
|
+
}
|
73
75
|
}
|
74
76
|
)
|
75
77
|
.and_call_original
|
@@ -79,7 +81,6 @@ RSpec.describe RockRMS::Client::Refund, type: :model do
|
|
79
81
|
end
|
80
82
|
|
81
83
|
context "with amount param" do
|
82
|
-
|
83
84
|
subject(:resource) do
|
84
85
|
client.create_refund(
|
85
86
|
transaction_id: 3000,
|
@@ -98,30 +99,32 @@ RSpec.describe RockRMS::Client::Refund, type: :model do
|
|
98
99
|
expect(client).to receive(:post)
|
99
100
|
.with(
|
100
101
|
'FinancialTransactionRefunds',
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
'
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
102
|
+
{
|
103
|
+
'OriginalTransactionId' => 3000,
|
104
|
+
'RefundReasonValueId' => 1,
|
105
|
+
'FinancialTransaction' => {
|
106
|
+
'AuthorizedPersonAliasId' => 120,
|
107
|
+
'BatchId' => 1,
|
108
|
+
'FinancialGatewayId' => nil,
|
109
|
+
'FinancialPaymentDetailId' => 156,
|
110
|
+
'TransactionDateTime' => '2018-02-01',
|
111
|
+
'TransactionDetails' => [
|
112
|
+
{
|
113
|
+
"Amount"=>-7.56,
|
114
|
+
"AccountId"=>23,
|
115
|
+
"EntityTypeId" => nil,
|
116
|
+
"EntityId" => nil
|
117
|
+
},
|
118
|
+
{
|
119
|
+
"Amount"=>-67.99,
|
120
|
+
"AccountId"=>24,
|
121
|
+
"EntityTypeId" => nil,
|
122
|
+
"EntityId" => nil
|
123
|
+
}
|
124
|
+
],
|
125
|
+
'TransactionTypeValueId' => 53,
|
126
|
+
'TransactionCode' => nil
|
127
|
+
}
|
125
128
|
}
|
126
129
|
)
|
127
130
|
.and_call_original
|
@@ -57,12 +57,14 @@ RSpec.describe RockRMS::Client::SavedPaymentMethod, type: :model do
|
|
57
57
|
expect(client).to receive(:post)
|
58
58
|
.with(
|
59
59
|
'FinancialPersonSavedAccounts',
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
60
|
+
{
|
61
|
+
'Name' => 'Sapphire Preferred',
|
62
|
+
'ReferenceNumber' => 'card_1234',
|
63
|
+
'PersonAliasId' => 1,
|
64
|
+
'IsDefault' => 0,
|
65
|
+
'FinancialGatewayId' => 2,
|
66
|
+
'FinancialPaymentDetailId' => 1
|
67
|
+
}
|
66
68
|
).and_call_original
|
67
69
|
resource
|
68
70
|
end
|
@@ -50,7 +50,9 @@ RSpec.describe RockRMS::Client::TransactionDetail, type: :model do
|
|
50
50
|
expect(client).to receive(:patch)
|
51
51
|
.with(
|
52
52
|
'FinancialTransactionDetails/123',
|
53
|
-
|
53
|
+
{
|
54
|
+
'AccountId' => 2
|
55
|
+
}
|
54
56
|
).and_call_original
|
55
57
|
resource
|
56
58
|
end
|
@@ -70,9 +72,11 @@ RSpec.describe RockRMS::Client::TransactionDetail, type: :model do
|
|
70
72
|
expect(client).to receive(:patch)
|
71
73
|
.with(
|
72
74
|
'FinancialTransactionDetails/123',
|
73
|
-
|
74
|
-
|
75
|
-
|
75
|
+
{
|
76
|
+
'FeeAmount' => 50,
|
77
|
+
'FeeCoverageAmount' => 45,
|
78
|
+
'AccountId' => 2
|
79
|
+
}
|
76
80
|
).and_call_original
|
77
81
|
resource
|
78
82
|
end
|
@@ -78,17 +78,19 @@ RSpec.describe RockRMS::Client::Transaction, type: :model do
|
|
78
78
|
expect(client).to receive(:post)
|
79
79
|
.with(
|
80
80
|
'FinancialTransactions',
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
81
|
+
{
|
82
|
+
'AuthorizedPersonAliasId' => 1,
|
83
|
+
'ScheduledTransactionId' => 1,
|
84
|
+
'BatchId' => 1,
|
85
|
+
'FinancialGatewayId' => nil,
|
86
|
+
'FinancialPaymentDetailId' => 1,
|
87
|
+
'TransactionCode' => 'asdf',
|
88
|
+
'TransactionDateTime' => 1,
|
89
|
+
'TransactionDetails' => [{ 'Amount' => 450, 'AccountId' => 2, 'EntityTypeId' => nil, 'EntityId' => nil, 'FeeAmount' => nil, 'FeeCoverageAmount' => nil }],
|
90
|
+
'TransactionTypeValueId' => 53,
|
91
|
+
'SourceTypeValueId' => 10,
|
92
|
+
'Summary' => 'taco tuesday'
|
93
|
+
}
|
92
94
|
)
|
93
95
|
.and_call_original
|
94
96
|
resource
|
@@ -114,10 +116,12 @@ RSpec.describe RockRMS::Client::Transaction, type: :model do
|
|
114
116
|
expect(client).to receive(:patch)
|
115
117
|
.with(
|
116
118
|
'FinancialTransactions/123',
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
119
|
+
{
|
120
|
+
'BatchId' => 1,
|
121
|
+
'Summary' => 'taco tuesday',
|
122
|
+
'TransactionTypeValueId' => 54,
|
123
|
+
'SourceTypeValueId' => 5
|
124
|
+
}
|
121
125
|
)
|
122
126
|
.and_call_original
|
123
127
|
resource
|
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:
|
4
|
+
version: 7.0.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: 2022-
|
11
|
+
date: 2022-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '2.
|
75
|
+
version: '2.3'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '2.
|
82
|
+
version: '2.3'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: dotenv
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -350,7 +350,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
350
350
|
requirements:
|
351
351
|
- - "~>"
|
352
352
|
- !ruby/object:Gem::Version
|
353
|
-
version: '2.
|
353
|
+
version: '2.7'
|
354
354
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
355
355
|
requirements:
|
356
356
|
- - ">="
|