rock_rms 9.32.0 → 9.33.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 33ea63e0755ff6b0496fa1bc6b7d982964c27e9b32413bad8f2f819f068a9f1b
4
- data.tar.gz: 43540e6a12c9b6c718e46faea6475255fed605d875ea834dcf2bd5c93a51bd60
3
+ metadata.gz: 52ef97fc950fc82099df84057de05eb60ac5be90be48d5d8adc5e7113b13bb66
4
+ data.tar.gz: 15346c8eabf48b48142830a968dff06957053375255aa31ce17975bb3383afd0
5
5
  SHA512:
6
- metadata.gz: 85dd1ee2e95b3690ea5fa3b35f901ac9f8b8c70c510ed680486b118d20e7f78bca015749cfb8362922a5886f7f215227fddbc0c0e97263f2d8079ace06d4429c
7
- data.tar.gz: e2bf9dd0769568622f0ef3b72e01220d340ca250a1fd0f35dae3eb0f3f52167798564c68800a4cbcec1875fc385efa0cda6cee6af3f19d51edc0c7419f87a345
6
+ metadata.gz: 5f36b4d339975854b718174a937e6993aaf2f086f9f18f4ae6a5bbc40ce3f68cfaed5dc1c4c4fa824498672ccba16f1ffad889f7c651a8d5b0dc9f71d7b72d63
7
+ data.tar.gz: 0da5c0f20259abd6081fdf923c4a5c4bb9bad503559a2e249e320c96d2793546d79e5f3318a8e46013a46a55c2a1d3d062f160c3c561ed4656bab223d5ed6b35
@@ -15,6 +15,7 @@ jobs:
15
15
  - name: Set up Ruby
16
16
  uses: ruby/setup-ruby@v1
17
17
  with:
18
+ ruby-version: '3.3'
18
19
  bundler-cache: true
19
20
  - name: Install dependencies
20
21
  run: bundle install
@@ -12,7 +12,6 @@ module RockRMS
12
12
  amount: nil,
13
13
  gateway_id: nil
14
14
  )
15
-
16
15
  old_transaction = list_transactions(
17
16
  '$expand' => 'TransactionDetails',
18
17
  '$filter' => "Id eq #{transaction_id}"
@@ -20,24 +19,26 @@ module RockRMS
20
19
 
21
20
  transaction_amount = old_transaction[:details].map{|d| d[:amount]}.reduce(0.0){|sum,x| sum + x }
22
21
 
23
-
24
22
  refund_amount = amount || transaction_amount
25
23
 
24
+ financial_transaction = {
25
+ 'AuthorizedPersonAliasId' => old_transaction[:person_id],
26
+ 'BatchId' => batch_id,
27
+ 'FinancialGatewayId' => gateway_id,
28
+ 'FinancialPaymentDetailId' => old_transaction[:payment_detail_id],
29
+ 'TransactionCode' => transaction_code,
30
+ 'TransactionDateTime' => date,
31
+ 'TransactionDetails' => refunded_details(old_transaction[:details], transaction_amount, refund_amount),
32
+ 'TransactionTypeValueId' => old_transaction[:transaction_type_id],
33
+ 'SourceTypeValueId' => old_transaction[:source_type_id],
34
+ 'ScheduledTransactionId' => old_transaction[:recurring_donation_id]
35
+ }
36
+ financial_transaction['ShowAsAnonymous'] = true if old_transaction[:show_as_anonymous]
37
+
26
38
  params = {
27
39
  'OriginalTransactionId' => transaction_id,
28
40
  'RefundReasonValueId' => reason_id,
29
- 'FinancialTransaction' => {
30
- 'AuthorizedPersonAliasId' => old_transaction[:person_id],
31
- 'BatchId' => batch_id,
32
- 'FinancialGatewayId' => gateway_id,
33
- 'FinancialPaymentDetailId' => old_transaction[:payment_detail_id],
34
- 'TransactionCode' => transaction_code,
35
- 'TransactionDateTime' => date,
36
- 'TransactionDetails' => refunded_details(old_transaction[:details], transaction_amount, refund_amount),
37
- 'TransactionTypeValueId' => old_transaction[:transaction_type_id],
38
- 'SourceTypeValueId' => old_transaction[:source_type_id],
39
- 'ScheduledTransactionId' => old_transaction[:recurring_donation_id]
40
- }
41
+ 'FinancialTransaction' => financial_transaction
41
42
  }
42
43
  post(refund_path, params)
43
44
  end
@@ -46,6 +46,7 @@ module RockRMS
46
46
  'SourceTypeValueId' => source_type_id, # website, kiosk, mobile app
47
47
  'Summary' => summary
48
48
  }
49
+ options['ShowAsAnonymous'] = show_as_anonymous if show_as_anonymous
49
50
  post(transaction_path, options)
50
51
  end
51
52
 
@@ -1,3 +1,3 @@
1
1
  module RockRMS
2
- VERSION = '9.32.0'.freeze
2
+ VERSION = '9.33.0'.freeze
3
3
  end
@@ -135,5 +135,50 @@ RSpec.describe RockRMS::Client::Refund, type: :model do
135
135
  resource
136
136
  end
137
137
  end
138
+
139
+ context 'show_as_anonymous' do
140
+ subject(:resource) do
141
+ client.create_refund(
142
+ transaction_id: 3000,
143
+ batch_id: 1,
144
+ date: '2018-02-01',
145
+ reason_id: 1
146
+ )
147
+ end
148
+
149
+ before do
150
+ allow(client).to receive(:list_transactions).and_wrap_original do |original, *args|
151
+ original.call(*args).map { |t| t.merge(show_as_anonymous: original_flag) }
152
+ end
153
+ end
154
+
155
+ context 'when the original transaction is anonymous' do
156
+ let(:original_flag) { true }
157
+
158
+ it 'passes ShowAsAnonymous' do
159
+ expect(client).to receive(:post)
160
+ .with(
161
+ 'FinancialTransactionRefunds',
162
+ hash_including('FinancialTransaction' => hash_including('ShowAsAnonymous' => true))
163
+ )
164
+ .and_call_original
165
+ resource
166
+ end
167
+ end
168
+
169
+ context 'when the original transaction is not anonymous' do
170
+ let(:original_flag) { false }
171
+
172
+ it 'leaves ShowAsAnonymous out' do
173
+ expect(client).to receive(:post)
174
+ .with(
175
+ 'FinancialTransactionRefunds',
176
+ hash_including('FinancialTransaction' => hash_excluding('ShowAsAnonymous'))
177
+ )
178
+ .and_call_original
179
+ resource
180
+ end
181
+ end
182
+ end
138
183
  end
139
184
  end
@@ -95,6 +95,26 @@ RSpec.describe RockRMS::Client::Transaction, type: :model do
95
95
  .and_call_original
96
96
  resource
97
97
  end
98
+
99
+ context 'with show_as_anonymous' do
100
+ subject(:resource) do
101
+ client.create_transaction(
102
+ authorized_person_id: 1,
103
+ batch_id: 1,
104
+ date: 1,
105
+ funds: [{ amount: 450, fund_id: 2 }],
106
+ payment_detail_id: 1,
107
+ show_as_anonymous: true
108
+ )
109
+ end
110
+
111
+ it 'passes ShowAsAnonymous' do
112
+ expect(client).to receive(:post)
113
+ .with('FinancialTransactions', hash_including('ShowAsAnonymous' => true))
114
+ .and_call_original
115
+ resource
116
+ end
117
+ end
98
118
  end
99
119
 
100
120
  describe '#update_transaction' do
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: 9.32.0
4
+ version: 9.33.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: 2026-07-07 00:00:00.000000000 Z
11
+ date: 2026-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday