rock_rms 5.18.0 → 6.0.3

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: 6d38cb217370fdd9d6a717b2e1e9beaccfaf19984f87292caed41c5e3d6ddb6b
4
- data.tar.gz: deedae759828e2ec7f31a759773ee75310eb415ae3df5cb78592be7d39c9c53d
3
+ metadata.gz: 1e4f3c74008fb007410ec62c7762913304cbfc0141e1a017b20a6256a348e257
4
+ data.tar.gz: 250452aea3db67e7c07105f1c6f3434312d60778b45a5b35e997bb75f8e27565
5
5
  SHA512:
6
- metadata.gz: c422bf568147f352726190aa9471869a1e6246d8742b5ad94a90e222bde9e9624a31700f395fdffb16198131ef44638119f3474932ef62e4904c8c23a6adc90e
7
- data.tar.gz: 15106868e69595ecf30e705172a75ae65d16dfcfca1c7ed8b85d23952515e8e2163a20321718cc8689f2858ac901156afef2f27cb969980b49c12d1cb52dc61a
6
+ metadata.gz: 896053a39d2f04344275040f71ab0265ece50ba5925994ed5a2b0bd551dc3b07614f58624b44796c874fdb44c79267d328a7c617f0c9fa1ce993c8a748f44ad0
7
+ data.tar.gz: a4f8ddc5a6b4325e972fb30270d122857d4ea6a74e2db0a9ccb6d82e141c43666ac28ca6da23b2be40f230c8bd671c471104cb69f0e5d9c1eacfe75af31dbb08
@@ -1,5 +1,6 @@
1
1
  module RockRMS
2
2
  class Error < StandardError; end
3
+ class BadGateway < Error; end
3
4
  class BadRequest < Error; end
4
5
  class Forbidden < Error; end
5
6
  class GatewayTimeout < Error; end
@@ -26,6 +27,8 @@ module FaradayMiddleware
26
27
  raise RockRMS::NotFound, error_message(env)
27
28
  when 500
28
29
  raise RockRMS::InternalServerError, error_message(env)
30
+ when 502
31
+ raise RockRMS::BadGateway, error_message(env)
29
32
  when 503
30
33
  raise RockRMS::ServiceUnavailable, error_message(env)
31
34
  when 504
@@ -99,7 +99,8 @@ module RockRMS
99
99
  'Amount' => fund[:amount],
100
100
  'AccountId' => fund[:fund_id],
101
101
  'EntityTypeId' => fund[:entity_type_id],
102
- 'EntityId' => fund[:entity_id]
102
+ 'EntityId' => fund[:entity_id],
103
+ 'FeeAmount' => fund[:fee_amount]
103
104
  }
104
105
  end
105
106
  end
@@ -16,15 +16,17 @@ module RockRMS
16
16
  fund_id: nil,
17
17
  amount: nil,
18
18
  fee_amount: nil,
19
+ fee_coverage_amount: nil,
19
20
  entity_type_id: nil,
20
21
  entity_id: nil
21
22
  )
22
23
  options = {}
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
24
+ options['AccountId'] = fund_id if fund_id
25
+ options['Amount'] = amount if amount
26
+ options['FeeAmount'] = fee_amount if fee_amount
27
+ options['EntityTypeId'] = entity_type_id if entity_type_id
28
+ options['EntityId'] = entity_id if entity_id
29
+ options['FeeCoverageAmount'] = fee_coverage_amount if fee_coverage_amount
28
30
 
29
31
  patch(transaction_detail_path(id), options)
30
32
  end
@@ -1,3 +1,3 @@
1
1
  module RockRMS
2
- VERSION = '5.18.0'.freeze
2
+ VERSION = '6.0.3'.freeze
3
3
  end
@@ -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, 'EntityId' => nil, 'EntityTypeId' => nil }],
142
+ 'ScheduledTransactionDetails' => [{ 'Amount' => 450, 'AccountId' => 2, 'EntityId' => nil, 'EntityTypeId' => nil, 'FeeAmount' => nil }],
143
143
  'GatewayScheduleId' => nil,
144
144
  'SourceTypeValueId' => 10,
145
145
  'ForeignKey' => nil
@@ -34,24 +34,49 @@ RSpec.describe RockRMS::Client::TransactionDetail, type: :model do
34
34
  end
35
35
 
36
36
  describe '#update_transaction_detail' do
37
- subject(:resource) do
38
- client.update_transaction_detail(
39
- 123,
40
- fund_id: 2,
41
- )
42
- end
37
+ context 'simple' do
38
+ subject(:resource) do
39
+ client.update_transaction_detail(
40
+ 123,
41
+ fund_id: 2,
42
+ )
43
+ end
44
+
45
+ it 'returns nothing' do
46
+ expect(client.update_transaction_detail(123, fund_id: 5)).to eq(nil)
47
+ end
43
48
 
44
- it 'returns nothing' do
45
- expect(client.update_transaction_detail(123, fund_id: 5)).to eq(nil)
49
+ it 'passes options' do
50
+ expect(client).to receive(:patch)
51
+ .with(
52
+ 'FinancialTransactionDetails/123',
53
+ 'AccountId' => 2
54
+ ).and_call_original
55
+ resource
56
+ end
46
57
  end
47
58
 
48
- it 'passes options' do
49
- expect(client).to receive(:patch)
50
- .with(
51
- 'FinancialTransactionDetails/123',
52
- 'AccountId' => 2
53
- ).and_call_original
54
- resource
59
+ context 'complex' do
60
+ subject(:resource) do
61
+ client.update_transaction_detail(
62
+ 123,
63
+ fund_id: 2,
64
+ fee_amount: 50,
65
+ fee_coverage_amount: 45
66
+ )
67
+ end
68
+
69
+ it 'passes options' do
70
+ expect(client).to receive(:patch)
71
+ .with(
72
+ 'FinancialTransactionDetails/123',
73
+ 'FeeAmount' => 50,
74
+ 'FeeCoverageAmount' => 45,
75
+ 'AccountId' => 2
76
+ ).and_call_original
77
+ resource
78
+ end
55
79
  end
80
+
56
81
  end
57
82
  end
@@ -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, 'EntityTypeId' => nil, 'EntityId' => nil }],
88
+ 'TransactionDetails' => [{ 'Amount' => 450, 'AccountId' => 2, 'EntityTypeId' => nil, 'EntityId' => nil, 'FeeAmount' => nil }],
89
89
  'TransactionTypeValueId' => 53,
90
90
  'SourceTypeValueId' => 10,
91
91
  'Summary' => 'taco tuesday'
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.18.0
4
+ version: 6.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Brooks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-31 00:00:00.000000000 Z
11
+ date: 2022-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday