rock_rms 5.8.1 → 5.11.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/client.rb +13 -1
- data/lib/rock_rms/resources/saved_payment_method.rb +26 -0
- data/lib/rock_rms/resources/transaction.rb +3 -1
- data/lib/rock_rms/resources/transaction_detail.rb +13 -4
- data/lib/rock_rms/response/recurring_donation.rb +3 -1
- data/lib/rock_rms/response/recurring_donation_details.rb +3 -1
- data/lib/rock_rms/response/saved_payment_method.rb +1 -0
- data/lib/rock_rms/response/transaction_detail.rb +3 -1
- data/lib/rock_rms/version.rb +1 -1
- data/rock_rms.gemspec +1 -1
- data/spec/rock_rms/resources/recurring_donation_spec.rb +1 -1
- data/spec/rock_rms/resources/transaction_spec.rb +1 -1
- data/spec/rock_rms/response/recurring_donation_spec.rb +2 -0
- data/spec/rock_rms/response/transaction_detail_spec.rb +2 -0
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61f5253a37866cd7066b265bd4fd005abc144f9f332b6687359ec814b6a9d8d8
|
4
|
+
data.tar.gz: da5df5d17ce802f4a1d805852d972f31b3f6a80a5f995b308b1d3d5f3a676c73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7897dfc323efcacecf20d7c226fe3a45150afb4578411c2a0657bb7edaa9e7b4b8654b8e768dfb2bcaeb77da7e91e6c55165e99c6108e508e46ea0ae1a9c3df
|
7
|
+
data.tar.gz: d4bfc24c2617b35dd8f905adcdd13ebcc4f92cb6d31b75cff59dc07b8e2e84da0d9675d42414d681093c572b89f6a3100c5c5cf963fe6cea87d938ab8ff0678d
|
data/lib/rock_rms/client.rb
CHANGED
@@ -75,8 +75,20 @@ module RockRMS
|
|
75
75
|
private
|
76
76
|
|
77
77
|
def auth
|
78
|
+
begin
|
79
|
+
auth_request('Auth/Login')
|
80
|
+
rescue Faraday::Error::ParsingError => e
|
81
|
+
if e.message.include?('Document Moved')
|
82
|
+
auth_request('auth/login')
|
83
|
+
else
|
84
|
+
raise e
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
def auth_request(path)
|
78
90
|
connection.post(
|
79
|
-
|
91
|
+
path,
|
80
92
|
'Username' => username,
|
81
93
|
'Password' => password,
|
82
94
|
'Persisted' => true
|
@@ -8,6 +8,7 @@ module RockRMS
|
|
8
8
|
|
9
9
|
def create_saved_payment_method(
|
10
10
|
gateway_id:,
|
11
|
+
gateway_person_id: nil,
|
11
12
|
payment_detail_id:,
|
12
13
|
person_alias_id:,
|
13
14
|
name:,
|
@@ -21,9 +22,34 @@ module RockRMS
|
|
21
22
|
'ReferenceNumber' => reference_number
|
22
23
|
}
|
23
24
|
|
25
|
+
if gateway_person_id
|
26
|
+
options['GatewayPersonIdentifier'] = gateway_person_id
|
27
|
+
end
|
28
|
+
|
24
29
|
post(saved_payment_method_path, options)
|
25
30
|
end
|
26
31
|
|
32
|
+
def update_saved_payment_method(
|
33
|
+
id,
|
34
|
+
gateway_id: nil,
|
35
|
+
gateway_person_id: nil,
|
36
|
+
payment_detail_id: nil,
|
37
|
+
person_alias_id: nil,
|
38
|
+
name: nil,
|
39
|
+
reference_number: nil
|
40
|
+
)
|
41
|
+
options = {}
|
42
|
+
|
43
|
+
options['FinancialGatewayId'] = gateway_id if gateway_id
|
44
|
+
options['GatewayPersonIdentifier'] = gateway_person_id if gateway_person_id
|
45
|
+
options['FinancialPaymentDetailId'] = payment_detail_id if payment_detail_id
|
46
|
+
options['Name'] = name if name
|
47
|
+
options['PersonAliasId'] = person_alias_id if person_alias_id
|
48
|
+
options['ReferenceNumber'] = reference_number if reference_number
|
49
|
+
|
50
|
+
patch(saved_payment_method_path(id), options)
|
51
|
+
end
|
52
|
+
|
27
53
|
def delete_saved_payment_method(id)
|
28
54
|
delete(saved_payment_method_path(id))
|
29
55
|
end
|
@@ -11,11 +11,20 @@ module RockRMS
|
|
11
11
|
Response::TransactionDetail.format(res)
|
12
12
|
end
|
13
13
|
|
14
|
-
def update_transaction_detail(
|
14
|
+
def update_transaction_detail(
|
15
|
+
id,
|
16
|
+
fund_id: nil,
|
17
|
+
amount: nil,
|
18
|
+
fee_amount: nil,
|
19
|
+
entity_type_id: nil,
|
20
|
+
entity_id: nil
|
21
|
+
)
|
15
22
|
options = {}
|
16
|
-
options['AccountId']
|
17
|
-
options['Amount']
|
18
|
-
options['FeeAmount']
|
23
|
+
options['AccountId'] = fund_id if fund_id
|
24
|
+
options['Amount'] = amount if amount
|
25
|
+
options['FeeAmount'] = fee_amount if fee_amount
|
26
|
+
options['EntityTypeId'] = entity_type_id if entity_type_id
|
27
|
+
options['EntityId'] = entity_id if entity_id
|
19
28
|
|
20
29
|
patch(transaction_detail_path(id), options)
|
21
30
|
end
|
@@ -13,7 +13,9 @@ module RockRMS
|
|
13
13
|
person_id: 'AuthorizedPersonAliasId',
|
14
14
|
start_date: 'StartDate',
|
15
15
|
transaction_details: 'ScheduledTransactionDetails',
|
16
|
-
transaction_code: 'TransactionCode'
|
16
|
+
transaction_code: 'TransactionCode',
|
17
|
+
transaction_type_id: 'TransactionTypeValueId',
|
18
|
+
summary: 'Summary'
|
17
19
|
}.freeze
|
18
20
|
|
19
21
|
def format_single(data)
|
data/lib/rock_rms/version.rb
CHANGED
data/rock_rms.gemspec
CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
|
|
28
28
|
s.add_development_dependency 'bundler', '~> 2.0'
|
29
29
|
s.add_development_dependency 'dotenv'
|
30
30
|
s.add_development_dependency 'pry'
|
31
|
-
s.add_development_dependency 'rake', '~>
|
31
|
+
s.add_development_dependency 'rake', '~> 12.3.3'
|
32
32
|
s.add_development_dependency 'rspec', '~> 3.7'
|
33
33
|
s.add_development_dependency 'sinatra', '~> 2.0'
|
34
34
|
s.add_development_dependency 'webmock', '~> 3.1'
|
@@ -139,7 +139,7 @@ RSpec.describe RockRMS::Client::RecurringDonation, type: :model do
|
|
139
139
|
'FinancialGatewayId' => nil,
|
140
140
|
'FinancialPaymentDetailId' => nil,
|
141
141
|
'TransactionCode' => 'asdf',
|
142
|
-
'ScheduledTransactionDetails' => [{ 'Amount' => 450, 'AccountId' => 2 }],
|
142
|
+
'ScheduledTransactionDetails' => [{ 'Amount' => 450, 'AccountId' => 2, 'EntityId' => nil, 'EntityTypeId' => nil }],
|
143
143
|
'GatewayScheduleId' => nil,
|
144
144
|
'SourceTypeValueId' => 10,
|
145
145
|
'ForeignKey' => nil
|
@@ -85,7 +85,7 @@ RSpec.describe RockRMS::Client::Transaction, type: :model do
|
|
85
85
|
'FinancialPaymentDetailId' => 1,
|
86
86
|
'TransactionCode' => 'asdf',
|
87
87
|
'TransactionDateTime' => 1,
|
88
|
-
'TransactionDetails' => [{ 'Amount' => 450, 'AccountId' => 2 }],
|
88
|
+
'TransactionDetails' => [{ 'Amount' => 450, 'AccountId' => 2, 'EntityTypeId' => nil, 'EntityId' => nil }],
|
89
89
|
'TransactionTypeValueId' => 53,
|
90
90
|
'SourceTypeValueId' => 10,
|
91
91
|
'Summary' => 'taco tuesday'
|
@@ -17,6 +17,8 @@ RSpec.describe RockRMS::Response::TransactionDetail, type: :model do
|
|
17
17
|
expect(r[:id]).to eq(p['Id'])
|
18
18
|
expect(r[:fund_id]).to eq(p['AccountId'])
|
19
19
|
expect(r[:amount]).to eq(p['Amount'])
|
20
|
+
expect(r[:entity_type_id]).to eq(p['EntityTypeId'])
|
21
|
+
expect(r[:entity_id]).to eq(p['EntityId'])
|
20
22
|
end
|
21
23
|
end
|
22
24
|
end
|
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.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taylor Brooks
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -114,14 +114,14 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
117
|
+
version: 12.3.3
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
124
|
+
version: 12.3.3
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: rspec
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -339,7 +339,7 @@ homepage: https://github.com/taylorbrooks/rock_rms
|
|
339
339
|
licenses:
|
340
340
|
- MIT
|
341
341
|
metadata: {}
|
342
|
-
post_install_message:
|
342
|
+
post_install_message:
|
343
343
|
rdoc_options: []
|
344
344
|
require_paths:
|
345
345
|
- lib
|
@@ -355,7 +355,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
355
355
|
version: '0'
|
356
356
|
requirements: []
|
357
357
|
rubygems_version: 3.1.4
|
358
|
-
signing_key:
|
358
|
+
signing_key:
|
359
359
|
specification_version: 4
|
360
360
|
summary: A Ruby wrapper for the Rock RMS API
|
361
361
|
test_files: []
|