rock_rms 9.13.0 → 9.15.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 +4 -4
- data/lib/rock_rms/client.rb +2 -0
- data/lib/rock_rms/parse_oj.rb +7 -0
- data/lib/rock_rms/resources/block_action.rb +15 -0
- data/lib/rock_rms/resources/registration_session.rb +23 -0
- data/lib/rock_rms/response/registration_session.rb +20 -0
- data/lib/rock_rms/version.rb +1 -1
- data/rock_rms.gemspec +2 -0
- data/spec/rock_rms/response/registration_session_spec.rb +54 -0
- data/spec/support/fixtures/registration_sessions.json +18 -0
- metadata +35 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c54c985591d6f2ea29eba426642b209ea1b812604e9484298dc2cc26d818722a
|
4
|
+
data.tar.gz: f2929fc58d2f2e34cafc60179af2476232059f1054e1cad98f9cbab6829ec83d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b73eba9bde8110b80ce14114bf1fc757c7455f2dd02a34ce26a6d41e6728465cb6be7cdd24d8bd524e4fdac2bcf1058337216756ae373be46110b82049bb8c6d
|
7
|
+
data.tar.gz: 0f749aa1e03fe013d2217946ce3afbc02678e4863f3c88ef659a75f30d9fc690d953babee6004fd442246a3aa55377ad2ea458341a51e21a0c19ca325f1e36aa
|
data/lib/rock_rms/client.rb
CHANGED
@@ -16,6 +16,7 @@ module RockRMS
|
|
16
16
|
include RockRMS::Client::Batch
|
17
17
|
include RockRMS::Client::BinaryFile
|
18
18
|
include RockRMS::Client::Block
|
19
|
+
include RockRMS::Client::BlockAction
|
19
20
|
include RockRMS::Client::BlockType
|
20
21
|
include RockRMS::Client::Fund
|
21
22
|
include RockRMS::Client::Campus
|
@@ -39,6 +40,7 @@ module RockRMS
|
|
39
40
|
include RockRMS::Client::Refund
|
40
41
|
include RockRMS::Client::RefundReason
|
41
42
|
include RockRMS::Client::Registration
|
43
|
+
include RockRMS::Client::RegistrationSession
|
42
44
|
include RockRMS::Client::SavedPaymentMethod
|
43
45
|
include RockRMS::Client::ServiceJob
|
44
46
|
include RockRMS::Client::SystemCommunication
|
data/lib/rock_rms/parse_oj.rb
CHANGED
@@ -7,6 +7,9 @@ module FaradayMiddleware
|
|
7
7
|
env[:body] = nil
|
8
8
|
elsif html_body?(env[:body])
|
9
9
|
env[:body] = env[:body]
|
10
|
+
elsif gzip_body?(env[:response_headers])
|
11
|
+
uncompressed_body = Zlib::GzipReader.new(StringIO.new(env[:body])).read
|
12
|
+
env[:body] = Oj.load(uncompressed_body, mode: :compat)
|
10
13
|
else
|
11
14
|
env[:body] = Oj.load(env[:body], mode: :compat)
|
12
15
|
end
|
@@ -14,6 +17,10 @@ module FaradayMiddleware
|
|
14
17
|
|
15
18
|
private
|
16
19
|
|
20
|
+
def gzip_body?(headers)
|
21
|
+
headers['content-type'] == 'application/gzip'
|
22
|
+
end
|
23
|
+
|
17
24
|
def html_body?(body)
|
18
25
|
/(<!DOCTYPE html>)|(<html>)/ =~ body
|
19
26
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module RockRMS
|
2
|
+
class Client
|
3
|
+
module BlockAction
|
4
|
+
def create_block_action(page_guid:, block_guid:, action_name:, body:)
|
5
|
+
post(block_action_path(page_guid, block_guid, action_name), body)
|
6
|
+
end
|
7
|
+
|
8
|
+
private
|
9
|
+
|
10
|
+
def block_action_path(page_guid, block_guid, action_name)
|
11
|
+
"v2/BlockActions/#{page_guid}/#{block_guid}/#{action_name}"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module RockRMS
|
2
|
+
class Client
|
3
|
+
module RegistrationSession
|
4
|
+
PATH = 'RegistrationSessions'.freeze
|
5
|
+
|
6
|
+
def list_registration_sessions(options = {})
|
7
|
+
res = get(registration_session_path, options)
|
8
|
+
Response::RegistrationSession.format(res)
|
9
|
+
end
|
10
|
+
|
11
|
+
def find_registration_session(id)
|
12
|
+
res = get(registration_session_path(id))
|
13
|
+
Response::RegistrationSession.format(res)
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def registration_session_path(id = nil)
|
19
|
+
id ? "#{PATH}/#{id}" : PATH
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module RockRMS
|
2
|
+
module Response
|
3
|
+
class RegistrationSession < Base
|
4
|
+
MAP = {
|
5
|
+
registration_instance_id: 'RegistrationInstanceId',
|
6
|
+
registration_data: 'RegistrationData',
|
7
|
+
session_start_date_time: 'SessionStartDateTime',
|
8
|
+
expiration_date_time: 'ExpirationDateTime',
|
9
|
+
client_ip_address: 'ClientIpAddress',
|
10
|
+
payment_gateway_reference: 'PaymentGatewayReference',
|
11
|
+
session_status: 'SessionStatus',
|
12
|
+
registration_id: 'RegistrationId'
|
13
|
+
}.freeze
|
14
|
+
|
15
|
+
def format_single(data)
|
16
|
+
to_h(MAP, data)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/rock_rms/version.rb
CHANGED
data/rock_rms.gemspec
CHANGED
@@ -22,6 +22,8 @@ Gem::Specification.new do |s|
|
|
22
22
|
|
23
23
|
s.add_runtime_dependency 'faraday', '> 2.0'
|
24
24
|
s.add_runtime_dependency 'faraday-multipart'
|
25
|
+
s.add_runtime_dependency 'zlib'
|
26
|
+
s.add_runtime_dependency 'stringio'
|
25
27
|
s.add_runtime_dependency 'json'
|
26
28
|
s.add_runtime_dependency 'oj'
|
27
29
|
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe RockRMS::Response::RegistrationSession, type: :model do
|
4
|
+
let(:parsed) { JSON.parse(FixturesHelper.read('registration_sessions.json')) }
|
5
|
+
|
6
|
+
describe '.format' do
|
7
|
+
subject(:result) { described_class.format(parsed) }
|
8
|
+
|
9
|
+
context 'when response is array' do
|
10
|
+
it 'returns an array' do
|
11
|
+
expect(described_class.format([])).to be_a(Array)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'has the following keys' do
|
16
|
+
response = result.first
|
17
|
+
expected_keys = %i[
|
18
|
+
registration_instance_id
|
19
|
+
registration_data
|
20
|
+
session_start_date_time
|
21
|
+
expiration_date_time
|
22
|
+
client_ip_address
|
23
|
+
payment_gateway_reference
|
24
|
+
session_status
|
25
|
+
registration_id
|
26
|
+
id
|
27
|
+
guid
|
28
|
+
created_date_time
|
29
|
+
modified_date_time
|
30
|
+
created_by_person_alias_id
|
31
|
+
attributes
|
32
|
+
attribute_values
|
33
|
+
foreign_key
|
34
|
+
]
|
35
|
+
|
36
|
+
expect(response.keys).to eq(expected_keys)
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'translates keys' do
|
40
|
+
result.zip(parsed) do |r, p|
|
41
|
+
expect(r[:id]).to eq(p['Id'])
|
42
|
+
expect(r[:guid]).to eq(p['Guid'])
|
43
|
+
expect(r[:registration_instance_id]).to eq(p['RegistrationInstanceId'])
|
44
|
+
expect(r[:registration_data]).to eq(p['RegistrationData'])
|
45
|
+
expect(r[:session_start_date_time]).to eq(p['SessionStartDateTime'])
|
46
|
+
expect(r[:expiration_date_time]).to eq(p['ExpirationDateTime'])
|
47
|
+
expect(r[:client_ip_address]).to eq(p['ClientIpAddress'])
|
48
|
+
expect(r[:payment_gateway_reference]).to eq(p['PaymentGatewayReference'])
|
49
|
+
expect(r[:session_status]).to eq(p['SessionStatus'])
|
50
|
+
expect(r[:registration_id]).to eq(p['RegistrationId'])
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"Id": 1,
|
4
|
+
"Guid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
|
5
|
+
"RegistrationInstanceId": 123,
|
6
|
+
"RegistrationData": "{\"SomeData\":\"Value\"}",
|
7
|
+
"SessionStartDateTime": "2025-03-09T12:00:00.000Z",
|
8
|
+
"ExpirationDateTime": "2025-03-10T12:00:00.000Z",
|
9
|
+
"ClientIpAddress": "192.168.1.1",
|
10
|
+
"PaymentGatewayReference": "ref123456",
|
11
|
+
"SessionStatus": 1,
|
12
|
+
"RegistrationId": 456,
|
13
|
+
"CreatedDateTime": "2025-03-09T12:00:00.000Z",
|
14
|
+
"ModifiedDateTime": "2025-03-09T12:00:00.000Z",
|
15
|
+
"CreatedByPersonAliasId": 789,
|
16
|
+
"ForeignKey": null
|
17
|
+
}
|
18
|
+
]
|
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.
|
4
|
+
version: 9.15.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:
|
11
|
+
date: 2025-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -38,6 +38,34 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: zlib
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: stringio
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
41
69
|
- !ruby/object:Gem::Dependency
|
42
70
|
name: json
|
43
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -192,6 +220,7 @@ files:
|
|
192
220
|
- lib/rock_rms/resources/batch.rb
|
193
221
|
- lib/rock_rms/resources/binary_file.rb
|
194
222
|
- lib/rock_rms/resources/block.rb
|
223
|
+
- lib/rock_rms/resources/block_action.rb
|
195
224
|
- lib/rock_rms/resources/block_type.rb
|
196
225
|
- lib/rock_rms/resources/campus.rb
|
197
226
|
- lib/rock_rms/resources/content_channel.rb
|
@@ -215,6 +244,7 @@ files:
|
|
215
244
|
- lib/rock_rms/resources/refund.rb
|
216
245
|
- lib/rock_rms/resources/refund_reason.rb
|
217
246
|
- lib/rock_rms/resources/registration.rb
|
247
|
+
- lib/rock_rms/resources/registration_session.rb
|
218
248
|
- lib/rock_rms/resources/saved_payment_method.rb
|
219
249
|
- lib/rock_rms/resources/service_job.rb
|
220
250
|
- lib/rock_rms/resources/system_communication.rb
|
@@ -256,6 +286,7 @@ files:
|
|
256
286
|
- lib/rock_rms/response/recurring_donation_details.rb
|
257
287
|
- lib/rock_rms/response/registration.rb
|
258
288
|
- lib/rock_rms/response/registration_instance.rb
|
289
|
+
- lib/rock_rms/response/registration_session.rb
|
259
290
|
- lib/rock_rms/response/saved_payment_method.rb
|
260
291
|
- lib/rock_rms/response/service_job.rb
|
261
292
|
- lib/rock_rms/response/system_communication.rb
|
@@ -312,6 +343,7 @@ files:
|
|
312
343
|
- spec/rock_rms/response/phone_number_spec.rb
|
313
344
|
- spec/rock_rms/response/recurring_donation_details_spec.rb
|
314
345
|
- spec/rock_rms/response/recurring_donation_spec.rb
|
346
|
+
- spec/rock_rms/response/registration_session_spec.rb
|
315
347
|
- spec/rock_rms/response/transaction_detail_spec.rb
|
316
348
|
- spec/rock_rms/response/transaction_spec.rb
|
317
349
|
- spec/rock_rms/response/workflow_action_type_spec.rb
|
@@ -365,6 +397,7 @@ files:
|
|
365
397
|
- spec/support/fixtures/recurring_donation.json
|
366
398
|
- spec/support/fixtures/recurring_donation_details.json
|
367
399
|
- spec/support/fixtures/recurring_donations.json
|
400
|
+
- spec/support/fixtures/registration_sessions.json
|
368
401
|
- spec/support/fixtures/saved_payment_methods.json
|
369
402
|
- spec/support/fixtures/transaction.json
|
370
403
|
- spec/support/fixtures/transaction_detail.json
|