rock_rms 8.6.0 → 8.8.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: a9c04e1fe039a7d8bfadb17f09ba3bae6c9da6519b501dcaa0e911fd590b81df
4
- data.tar.gz: 4ad41691163a7479d9b80387f3d36072a487238cbc1235844e5a718ff2452fd8
3
+ metadata.gz: 22ac74e1335ccb310b66334383def8e6ac0554662ceddcda863e70314658a758
4
+ data.tar.gz: 27d640dd2d45aa40457c1ef489336892d2c479d495925dca63030987a5e25b88
5
5
  SHA512:
6
- metadata.gz: 7483f4c398437d73dcfb1daa0bbd1fa9cbea89a52bfb2ed8b5fee65f3567048564d6634b544d59aec684c78d6879d749428d1d2f7f37a0c991836e54c4f881f3
7
- data.tar.gz: e53e8d7a856f72fd85b4bec5fe21c7f95bfc59d9d564417262076d1a082ec793c4a565dd9a9ada1cf80e80d9b0b54f57defcd0825edc1d935fb433c989c47187
6
+ metadata.gz: e3a8125e04b0203458db96c5dbf86dc6231d4f6f2475c841379447ceb9f56b93eff5a153fc85e569b4bd7108b3b76e926624accd177153e31a54666d032b0d3e
7
+ data.tar.gz: 89e930161caac74f7be2bada2d71fa8a3be2298b14ce30d2964e626c4e5662c463dd0f26153f49a07763fda3406ac551580b667abb0145e9cbeebde885200e37
@@ -1,5 +1,4 @@
1
1
  require 'faraday'
2
- require 'faraday_middleware'
3
2
  require 'faraday/multipart'
4
3
 
5
4
  Dir[File.expand_path('../resources/*.rb', __FILE__)].each { |f| require f }
@@ -13,7 +13,7 @@ end
13
13
 
14
14
  require 'faraday'
15
15
  module FaradayMiddleware
16
- class RockRMSErrorHandler < Faraday::Response::Middleware
16
+ class RockRMSErrorHandler < Faraday::Middleware
17
17
  ERROR_STATUSES = 400..600
18
18
 
19
19
  def on_complete(env)
@@ -1,11 +1,19 @@
1
- require 'faraday_middleware/response_middleware'
1
+ require 'oj'
2
2
 
3
3
  module FaradayMiddleware
4
- class ParseOj < ResponseMiddleware
5
- dependency 'oj'
4
+ class ParseOj < Faraday::Middleware
5
+ def on_complete(env)
6
+ if empty_body?(env[:body].strip)
7
+ env[:body] = nil
8
+ else
9
+ env[:body] = Oj.load(env[:body], mode: :compat)
10
+ end
11
+ end
12
+
13
+ private
6
14
 
7
- define_parser do |body|
8
- Oj.load(body, mode: :compat) unless body.strip.empty?
15
+ def empty_body?(body)
16
+ body.empty? && body == ''
9
17
  end
10
18
  end
11
19
  end
@@ -24,7 +24,8 @@ module RockRMS
24
24
  payment_detail_id: nil,
25
25
  source_type_id: 10,
26
26
  transaction_code: nil,
27
- start_date:
27
+ start_date:,
28
+ summary: nil
28
29
  )
29
30
 
30
31
  options = {
@@ -39,7 +40,8 @@ module RockRMS
39
40
  'ScheduledTransactionDetails' => translate_funds(funds),
40
41
  'GatewayScheduleId' => gateway_schedule_id,
41
42
  'SourceTypeValueId' => source_type_id,
42
- 'ForeignKey' => foreign_key
43
+ 'ForeignKey' => foreign_key,
44
+ 'Summary' => summary
43
45
  }
44
46
 
45
47
  options['EndDate'] = end_date if end_date
@@ -54,14 +56,16 @@ module RockRMS
54
56
  payment_detail_id: nil,
55
57
  active: nil,
56
58
  frequency: nil,
57
- end_date: nil
59
+ end_date: nil,
60
+ summary: nil
58
61
  )
59
62
  options = { 'NextPaymentDate' => next_payment_date }
60
63
  options['FinancialPaymentDetailId'] = payment_detail_id if payment_detail_id
61
64
  options['TransactionCode'] = transaction_code if transaction_code
62
65
  options['IsActive'] = active if !active.nil?
63
66
  options['TransactionFrequencyValueId'] = RecurringFrequencies::RECURRING_FREQUENCIES[frequency] if !frequency.nil?
64
- options['EndDate'] = end_date if end_date
67
+ options['EndDate'] = end_date if end_date
68
+ options['Summary'] = summary if summary
65
69
 
66
70
  patch(recurring_donation_path(id), options)
67
71
  end
@@ -1,3 +1,3 @@
1
1
  module RockRMS
2
- VERSION = '8.6.0'.freeze
2
+ VERSION = '8.8.0'.freeze
3
3
  end
data/rock_rms.gemspec CHANGED
@@ -20,8 +20,7 @@ Gem::Specification.new do |s|
20
20
 
21
21
  s.require_paths = ['lib']
22
22
 
23
- s.add_runtime_dependency 'faraday'
24
- s.add_runtime_dependency 'faraday_middleware'
23
+ s.add_runtime_dependency 'faraday', '> 2.0'
25
24
  s.add_runtime_dependency 'faraday-multipart'
26
25
  s.add_runtime_dependency 'json'
27
26
  s.add_runtime_dependency 'oj'
@@ -28,7 +28,7 @@ RSpec.describe RockRMS::Client do
28
28
  end
29
29
 
30
30
  it 'requries either `username` and `password` params or `authorization_token` param' do
31
- expect { described_class.new(attrs_without_authentication) }
31
+ expect { described_class.new(**attrs_without_authentication) }
32
32
  .to raise_error(ArgumentError, /username and password or authorization_token/)
33
33
  end
34
34
 
@@ -145,7 +145,8 @@ RSpec.describe RockRMS::Client::RecurringDonation, type: :model do
145
145
  'ScheduledTransactionDetails' => [{ 'Amount' => 450, 'AccountId' => 2, 'EntityId' => nil, 'EntityTypeId' => nil, 'FeeAmount' => nil, 'FeeCoverageAmount' => nil}],
146
146
  'GatewayScheduleId' => nil,
147
147
  'SourceTypeValueId' => 10,
148
- 'ForeignKey' => nil
148
+ 'ForeignKey' => nil,
149
+ 'Summary' => nil,
149
150
  }
150
151
  )
151
152
  .and_call_original
metadata CHANGED
@@ -1,43 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rock_rms
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.6.0
4
+ version: 8.8.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: 2023-04-18 00:00:00.000000000 Z
11
+ date: 2023-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
17
+ - - ">"
25
18
  - !ruby/object:Gem::Version
26
- version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: faraday_middleware
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
19
+ version: '2.0'
34
20
  type: :runtime
35
21
  prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
- - - ">="
24
+ - - ">"
39
25
  - !ruby/object:Gem::Version
40
- version: '0'
26
+ version: '2.0'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: faraday-multipart
43
29
  requirement: !ruby/object:Gem::Requirement