rock_rms 5.9.0 → 5.12.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b4c7c116742e1c3d7ad8ef95c87c5eb484af173bc6b0ec5de6a7692326f3b354
4
- data.tar.gz: edbd8b736d2bbbab53e7b71d814cbd8e660a68582e374e6a6a8c4558295b9005
3
+ metadata.gz: d0846074cb7439ee86aa25cab5c121e34b9f1486447a9caf12cd70ddd9fcee2f
4
+ data.tar.gz: 278d4f04e65c1c9c4db8fdd81121afc9bd5b7ecf45d27ad344d1336ef245e6bc
5
5
  SHA512:
6
- metadata.gz: de2c4e9ee063f1b1bb8ee4ebf1581965dcf13e2792e6767dc2e73b11bf9a8b5e36d89fe927f1ed348a8dade0657aea488282453408e47a0ff75106f790288594
7
- data.tar.gz: 5f7d2190935dc449ec0aefd52009b13335c5da527563f6c6a5836603afce29aceb4b9ab4d33958fb498a7a2e052ce8bb5d5303641a7fc5ae477e7cabe9ce79d0
6
+ metadata.gz: cf6d0f78e700c9c1f855001eab1421b923e549b9e8734ba9c8a5c26200dba355c9a4cd18f58b69a29d3cf09e37c4c8fac7fa6d90ed914f26d62cb6bc73324b15
7
+ data.tar.gz: 3d3ba0082dc04fbd03aadba0cbe0a439f767593d57234e744c52c09ccd7a8603570321f7f87bb8a7096c3bd2eb8c3a5ca1022e813e504a68fc59ab91b9704bc2
@@ -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
- 'Auth/Login',
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(id, fund_id: nil, amount: nil, fee_amount: nil)
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'] = fund_id if fund_id
17
- options['Amount'] = amount if amount
18
- options['FeeAmount'] = fee_amount if fee_amount
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
@@ -14,6 +14,7 @@ module RockRMS
14
14
  start_date: 'StartDate',
15
15
  transaction_details: 'ScheduledTransactionDetails',
16
16
  transaction_code: 'TransactionCode',
17
+ transaction_type_id: 'TransactionTypeValueId',
17
18
  summary: 'Summary'
18
19
  }.freeze
19
20
 
@@ -5,6 +5,7 @@ module RockRMS
5
5
  id: 'Id',
6
6
  foreign_key: 'ForeignKey',
7
7
  gateway_id: 'FinancialGatewayId',
8
+ gateway_person_id: 'GatewayPersonIdentifier',
8
9
  name: 'Name',
9
10
  payment_details: 'FinancialPaymentDetail',
10
11
  payment_detail_id: 'FinancialPaymentDetailId',
@@ -1,3 +1,3 @@
1
1
  module RockRMS
2
- VERSION = '5.9.0'.freeze
2
+ VERSION = '5.12.0'.freeze
3
3
  end
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', '~> 10.4'
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' => [{"Amount"=>-10.0, "AccountId"=>23}, {"Amount"=>-90.0, "AccountId"=>24}],
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' => [{"Amount"=>-7.56, "AccountId"=>23}, {"Amount"=>-67.99, "AccountId"=>24}],
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
  }
@@ -27,6 +27,7 @@ RSpec.describe RockRMS::Response::RecurringDonation, type: :model do
27
27
  start_date
28
28
  transaction_details
29
29
  transaction_code
30
+ transaction_type_id
30
31
  summary
31
32
  ]
32
33
 
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.9.0
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-03-17 00:00:00.000000000 Z
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: '10.4'
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: '10.4'
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: []