rock_rms 5.9.0 → 5.12.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 +13 -1
- data/lib/rock_rms/resources/refund.rb +3 -1
- data/lib/rock_rms/resources/saved_payment_method.rb +26 -0
- data/lib/rock_rms/resources/transaction_detail.rb +13 -4
- data/lib/rock_rms/response/recurring_donation.rb +1 -0
- data/lib/rock_rms/response/saved_payment_method.rb +1 -0
- data/lib/rock_rms/version.rb +1 -1
- data/rock_rms.gemspec +1 -1
- data/spec/rock_rms/resources/refund_spec.rb +28 -2
- data/spec/rock_rms/response/recurring_donation_spec.rb +1 -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: d0846074cb7439ee86aa25cab5c121e34b9f1486447a9caf12cd70ddd9fcee2f
|
|
4
|
+
data.tar.gz: 278d4f04e65c1c9c4db8fdd81121afc9bd5b7ecf45d27ad344d1336ef245e6bc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cf6d0f78e700c9c1f855001eab1421b923e549b9e8734ba9c8a5c26200dba355c9a4cd18f58b69a29d3cf09e37c4c8fac7fa6d90ed914f26d62cb6bc73324b15
|
|
7
|
+
data.tar.gz: 3d3ba0082dc04fbd03aadba0cbe0a439f767593d57234e744c52c09ccd7a8603570321f7f87bb8a7096c3bd2eb8c3a5ca1022e813e504a68fc59ab91b9704bc2
|
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
|
|
@@ -45,7 +45,9 @@ module RockRMS
|
|
|
45
45
|
apportion_refund_amount_over_accounts(details, transaction_amount, refund_amount).map do |dt|
|
|
46
46
|
{
|
|
47
47
|
'Amount' => -dt[:amount],
|
|
48
|
-
'AccountId' => dt[:fund_id]
|
|
48
|
+
'AccountId' => dt[:fund_id],
|
|
49
|
+
'EntityTypeId' => dt[:entity_type_id],
|
|
50
|
+
'EntityId' => dt[:entity_id]
|
|
49
51
|
}
|
|
50
52
|
end
|
|
51
53
|
end
|
|
@@ -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
|
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'
|
|
@@ -54,7 +54,20 @@ RSpec.describe RockRMS::Client::Refund, type: :model do
|
|
|
54
54
|
'FinancialGatewayId' => nil,
|
|
55
55
|
'FinancialPaymentDetailId' => 156,
|
|
56
56
|
'TransactionDateTime' => '2018-02-01',
|
|
57
|
-
'TransactionDetails' => [
|
|
57
|
+
'TransactionDetails' => [
|
|
58
|
+
{
|
|
59
|
+
"Amount"=>-10.0,
|
|
60
|
+
"AccountId"=>23,
|
|
61
|
+
"EntityTypeId" => nil,
|
|
62
|
+
"EntityId" => nil
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"Amount"=> -90.0,
|
|
66
|
+
"AccountId"=>24,
|
|
67
|
+
"EntityTypeId" => nil,
|
|
68
|
+
"EntityId" => nil
|
|
69
|
+
}
|
|
70
|
+
],
|
|
58
71
|
'TransactionTypeValueId' => 53,
|
|
59
72
|
'TransactionCode' => nil
|
|
60
73
|
}
|
|
@@ -93,7 +106,20 @@ RSpec.describe RockRMS::Client::Refund, type: :model do
|
|
|
93
106
|
'FinancialGatewayId' => nil,
|
|
94
107
|
'FinancialPaymentDetailId' => 156,
|
|
95
108
|
'TransactionDateTime' => '2018-02-01',
|
|
96
|
-
'TransactionDetails' => [
|
|
109
|
+
'TransactionDetails' => [
|
|
110
|
+
{
|
|
111
|
+
"Amount"=>-7.56,
|
|
112
|
+
"AccountId"=>23,
|
|
113
|
+
"EntityTypeId" => nil,
|
|
114
|
+
"EntityId" => nil
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"Amount"=>-67.99,
|
|
118
|
+
"AccountId"=>24,
|
|
119
|
+
"EntityTypeId" => nil,
|
|
120
|
+
"EntityId" => nil
|
|
121
|
+
}
|
|
122
|
+
],
|
|
97
123
|
'TransactionTypeValueId' => 53,
|
|
98
124
|
'TransactionCode' => nil
|
|
99
125
|
}
|
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.12.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: 2021-
|
|
11
|
+
date: 2021-07-01 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: []
|