rock_rms 5.8.0 → 5.10.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: 3f80037876165ae910a1e20ebc844295d312c0aafba86d84b031588b0594a7a9
4
- data.tar.gz: d1abcffed57ba80128b6be557125c93ab52ad1696f80c2c191280df42bcc5bf9
3
+ metadata.gz: f705adcfa522406e73d9b58360dfd1281d482baee3b0c62ff0d583cd58aadc83
4
+ data.tar.gz: a80754f004ef87d2ea78c0e8868e0cccb94b2aa62c72403e164def5e59066a91
5
5
  SHA512:
6
- metadata.gz: 470c18185dc8fb6b7a1d10e6686ad6bfa9b4224cf00a882237201f168c0f127185c3f2f243f3c46e4c419f8376cbf3f94f441babf289088d8549635cf3f6fd63
7
- data.tar.gz: bfd6a558830b9cb167dbe71772b79a1fcfe5a919bea9675ec06ec686e31755b7ed0ed7dd1b93a5596db6e2943494fae9777698fd91f39ed557c8d7666398038d
6
+ metadata.gz: 53d8575a6fe4704f7e5421414f22c0290550012c5bc8f654ef19b49cf99b1c5c92b7e47b017d37f3f43a07f3f422f42c44414790db586bccdea4147378aa1243
7
+ data.tar.gz: 7558483decd2edd69d23aaba0a2aa300131406dfa7232993c3d6b075a51c2bb78f343d0287f03b7a21ccc2ea934b204a41eb13c54a99112b46679a7f4ad7ad35
@@ -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
@@ -58,6 +58,10 @@ module RockRMS
58
58
  patch(recurring_donation_path(id), options)
59
59
  end
60
60
 
61
+ def delete_recurring_donation(id)
62
+ delete(recurring_donation_path(id))
63
+ end
64
+
61
65
  def launch_scheduled_transaction_workflow(
62
66
  id,
63
67
  workflow_type_id:,
@@ -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
@@ -97,7 +97,9 @@ module RockRMS
97
97
  funds.map do |fund|
98
98
  {
99
99
  'Amount' => fund[:amount],
100
- 'AccountId' => fund[:fund_id]
100
+ 'AccountId' => fund[:fund_id],
101
+ 'EntityTypeId' => fund[:entity_type_id],
102
+ 'EntityId' => fund[:entity_id]
101
103
  }
102
104
  end
103
105
  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
@@ -13,7 +13,8 @@ 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
+ summary: 'Summary'
17
18
  }.freeze
18
19
 
19
20
  def format_single(data)
@@ -2,9 +2,11 @@ module RockRMS
2
2
  module Response
3
3
  class RecurringDonationDetails < Base
4
4
  MAP = {
5
+ id: 'Id',
5
6
  amount: 'Amount',
6
7
  fund_id: 'AccountId',
7
- id: 'Id'
8
+ entity_type_id: 'EntityTypeId',
9
+ entity_id: 'EntityId'
8
10
  }.freeze
9
11
 
10
12
  def format_single(data)
@@ -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',
@@ -6,7 +6,9 @@ module RockRMS
6
6
  fee_amount: 'FeeAmount',
7
7
  fund: 'Account',
8
8
  fund_id: 'AccountId',
9
- amount: 'Amount'
9
+ amount: 'Amount',
10
+ entity_type_id: 'EntityTypeId',
11
+ entity_id: 'EntityId'
10
12
  }.freeze
11
13
 
12
14
  def format_single(response)
@@ -1,3 +1,3 @@
1
1
  module RockRMS
2
- VERSION = '5.8.0'.freeze
2
+ VERSION = '5.10.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'
@@ -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'
@@ -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
+ summary
30
31
  ]
31
32
 
32
33
  expect(response.keys).to eq(expected_keys)
@@ -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.8.0
4
+ version: 5.10.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-12-08 00:00:00.000000000 Z
11
+ date: 2021-04-27 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