rock_rms 3.5.0 → 3.6.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
  SHA1:
3
- metadata.gz: c00fac217eeef9ea0fab76853ba89e40024b5486
4
- data.tar.gz: 91246c29a9aae3d94277b2c0aac83818d6ca0de4
3
+ metadata.gz: 93022281b1fbfb9085f5e8d645efdb07c4365a22
4
+ data.tar.gz: 16c794212e821977c4ac7137574eee7fbfd6e1ad
5
5
  SHA512:
6
- metadata.gz: 282322cf79471e4200d3d740db23e39c63b8ae269cba1d01698a31d2c4f1f386ef62b36eeed914541c73bc47c8eee68409d857c597b33c2989c6d1b8f8ff1899
7
- data.tar.gz: dc93c383cdfc85236f010f9850f0680f88fecdd6e3bade52495f1703997746cd67567eaa710157fca958062ad4eb4e49252d7364f32c9c7a03c9dac2aa100b5a
6
+ metadata.gz: 7e70a139af03b29e0fc0bfcebf6c3d91e4d0e63e816e28289c7521190a8f6381ffab9253a5cebb5a68b7570563d31fef3f44f6876a09d3ed382f315dc1b83e25
7
+ data.tar.gz: 07215a3a976faffa8baf74214af142264e3afb42968721bb4681f5d59771beeeea7cff4ed064515e21d2e4283a62bfaaf460812bf404d897bc58d84f2fe6338c
data/README.md CHANGED
@@ -14,7 +14,7 @@ I'm a big fan of Rock so if you have problems using the gem or would like to see
14
14
  Add this line to your application's Gemfile:
15
15
  ````ruby
16
16
  # in your Gemfile
17
- gem 'rock_rms', '~> 1.1'
17
+ gem 'rock_rms', '~> 3.6'
18
18
 
19
19
  # then...
20
20
  bundle install
@@ -11,6 +11,7 @@ module RockRMS
11
11
  include RockRMS::Client::Batch
12
12
  include RockRMS::Client::Fund
13
13
  include RockRMS::Client::Campus
14
+ include RockRMS::Client::Gateway
14
15
  include RockRMS::Client::Group
15
16
  include RockRMS::Client::GroupMember
16
17
  include RockRMS::Client::PaymentMethod
@@ -0,0 +1,11 @@
1
+ module RockRMS
2
+ class Client
3
+ module Gateway
4
+ def list_gateways(options = {})
5
+ Response::Gateway.format(
6
+ get('FinancialGateways', options)
7
+ )
8
+ end
9
+ end
10
+ end
11
+ end
@@ -27,13 +27,15 @@ module RockRMS
27
27
  source_type_id: 10,
28
28
  transaction_code: nil,
29
29
  summary: nil,
30
- recurring_donation_id: nil
30
+ recurring_donation_id: nil,
31
+ gateway_id: nil
31
32
  )
32
33
 
33
34
  options = {
34
35
  'AuthorizedPersonAliasId' => authorized_person_id,
35
36
  'ScheduledTransactionId' => recurring_donation_id,
36
37
  'BatchId' => batch_id,
38
+ 'FinancialGatewayId' => gateway_id,
37
39
  'FinancialPaymentDetailId' => payment_type,
38
40
  'TransactionCode' => transaction_code,
39
41
  'TransactionDateTime' => date,
@@ -45,11 +47,18 @@ module RockRMS
45
47
  post(transaction_path, options)
46
48
  end
47
49
 
48
- def update_transaction(id, batch_id: nil, summary: nil, recurring_donation_id: nil)
50
+ def update_transaction(
51
+ id,
52
+ batch_id: nil,
53
+ summary: nil,
54
+ recurring_donation_id: nil,
55
+ gateway_id: nil
56
+ )
49
57
  options = {}
50
58
 
51
59
  options['Summary'] = summary if summary
52
60
  options['BatchId'] = batch_id if batch_id
61
+ options['FinancialGatewayId'] = gateway_id if gateway_id
53
62
  options['ScheduledTransactionId'] = recurring_donation_id if recurring_donation_id
54
63
 
55
64
  patch(transaction_path(id), options)
@@ -0,0 +1,15 @@
1
+ module RockRMS
2
+ module Response
3
+ class Gateway < Base
4
+ MAP = {
5
+ id: 'Id',
6
+ name: 'Name',
7
+ active: 'IsActive'
8
+ }.freeze
9
+
10
+ def format_single(data)
11
+ to_h(MAP, data)
12
+ end
13
+ end
14
+ end
15
+ end
@@ -6,6 +6,7 @@ module RockRMS
6
6
  date: 'TransactionDateTime',
7
7
  person_id: 'AuthorizedPersonAliasId',
8
8
  batch_id: 'BatchId',
9
+ gateway_id: 'FinancialGatewayId',
9
10
  recurring_donation_id: 'ScheduledTransactionId',
10
11
  summary: 'Summary',
11
12
  transaction_code: 'TransactionCode',
@@ -1,3 +1,3 @@
1
1
  module RockRMS
2
- VERSION = '3.5.0'.freeze
2
+ VERSION = '3.6.0'.freeze
3
3
  end
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe RockRMS::Client::Gateway, type: :model do
4
+ include_context 'resource specs'
5
+
6
+ describe '#list_gateways' do
7
+ it 'returns a array' do
8
+ resource = client.list_gateways
9
+ expect(resource).to be_a(Array)
10
+ expect(resource.first).to be_a(Hash)
11
+ end
12
+ end
13
+ end
@@ -81,6 +81,7 @@ RSpec.describe RockRMS::Client::Transaction, type: :model do
81
81
  'AuthorizedPersonAliasId' => 1,
82
82
  'ScheduledTransactionId' => 1,
83
83
  'BatchId' => 1,
84
+ 'FinancialGatewayId' => nil,
84
85
  'FinancialPaymentDetailId' => 1,
85
86
  'TransactionCode' => 'asdf',
86
87
  'TransactionDateTime' => 1,
@@ -0,0 +1,22 @@
1
+ [
2
+ {
3
+ "Name": "Simple Donation",
4
+ "Description": null,
5
+ "EntityTypeId": 5367,
6
+ "BatchTimeOffsetTicks": 0,
7
+ "IsActive": false,
8
+ "EntityType": null,
9
+ "CreatedDateTime": null,
10
+ "ModifiedDateTime": null,
11
+ "CreatedByPersonAliasId": null,
12
+ "ModifiedByPersonAliasId": null,
13
+ "ModifiedAuditValuesAlreadyUpdated": false,
14
+ "Attributes": null,
15
+ "AttributeValues": null,
16
+ "Id": 3,
17
+ "Guid": "b96bc08c-84e7-4c44-92e8-73a9488ed212",
18
+ "ForeignId": null,
19
+ "ForeignGuid": null,
20
+ "ForeignKey": null
21
+ }
22
+ ]
@@ -25,6 +25,7 @@ class RockMock < Sinatra::Base
25
25
  transaction: 'FinancialTransactions/:id',
26
26
  transactions: 'FinancialTransactions',
27
27
  families: 'Groups/GetFamilies/:id',
28
+ gateways: 'FinancialGateways',
28
29
  group: 'Groups/:id',
29
30
  groups: 'Groups',
30
31
  payment_methods: 'FinancialPaymentDetails',
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: 3.5.0
4
+ version: 3.6.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: 2018-03-17 00:00:00.000000000 Z
11
+ date: 2018-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -187,6 +187,7 @@ files:
187
187
  - lib/rock_rms/resources/batch.rb
188
188
  - lib/rock_rms/resources/campus.rb
189
189
  - lib/rock_rms/resources/fund.rb
190
+ - lib/rock_rms/resources/gateway.rb
190
191
  - lib/rock_rms/resources/group.rb
191
192
  - lib/rock_rms/resources/group_member.rb
192
193
  - lib/rock_rms/resources/payment_method.rb
@@ -201,6 +202,7 @@ files:
201
202
  - lib/rock_rms/response/batch.rb
202
203
  - lib/rock_rms/response/campus.rb
203
204
  - lib/rock_rms/response/fund.rb
205
+ - lib/rock_rms/response/gateway.rb
204
206
  - lib/rock_rms/response/group.rb
205
207
  - lib/rock_rms/response/group_location.rb
206
208
  - lib/rock_rms/response/location.rb
@@ -218,6 +220,7 @@ files:
218
220
  - spec/rock_rms/error_spec.rb
219
221
  - spec/rock_rms/resources/batch_spec.rb
220
222
  - spec/rock_rms/resources/campus_spec.rb
223
+ - spec/rock_rms/resources/gateway_spec.rb
221
224
  - spec/rock_rms/resources/group_member_spec.rb
222
225
  - spec/rock_rms/resources/group_spec.rb
223
226
  - spec/rock_rms/resources/payment_method_spec.rb
@@ -252,6 +255,7 @@ files:
252
255
  - spec/support/fixtures/create_refund.json
253
256
  - spec/support/fixtures/create_transaction.json
254
257
  - spec/support/fixtures/families.json
258
+ - spec/support/fixtures/gateways.json
255
259
  - spec/support/fixtures/group.json
256
260
  - spec/support/fixtures/group_locations.json
257
261
  - spec/support/fixtures/groups.json