rock_rms 5.12.0 → 5.16.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: d0846074cb7439ee86aa25cab5c121e34b9f1486447a9caf12cd70ddd9fcee2f
4
- data.tar.gz: 278d4f04e65c1c9c4db8fdd81121afc9bd5b7ecf45d27ad344d1336ef245e6bc
3
+ metadata.gz: 4d0a0e39eb6d9110441554494776848001292e154c9d8292fc9d9630735320b7
4
+ data.tar.gz: f35d764bd6269201cfeb03959483dc0c6394c95fd5f0bb3f2390869d5db731dc
5
5
  SHA512:
6
- metadata.gz: cf6d0f78e700c9c1f855001eab1421b923e549b9e8734ba9c8a5c26200dba355c9a4cd18f58b69a29d3cf09e37c4c8fac7fa6d90ed914f26d62cb6bc73324b15
7
- data.tar.gz: 3d3ba0082dc04fbd03aadba0cbe0a439f767593d57234e744c52c09ccd7a8603570321f7f87bb8a7096c3bd2eb8c3a5ca1022e813e504a68fc59ab91b9704bc2
6
+ metadata.gz: cdbb6ec3dcfcba4d57c9f5dc517fb82d65f3f8e7b7e5d95e8c0d41814b916cc079a1796737c0295ecd26f97fcfdb8adbb839642de5fbf1ff88997cb62701f2d3
7
+ data.tar.gz: bbb22c3d624928f5b157bcce8a0e5207b1f36e14b52bc9d1b897dd471cadaa45eba98f4acc57e3af1946e9c826fb938d62161d886a085c43dc8cd4f05a79f8af
@@ -41,14 +41,15 @@ module RockRMS
41
41
  include RockRMS::Client::WorkflowActivityType
42
42
  include RockRMS::Client::WorkflowType
43
43
 
44
- attr_reader :url, :username, :password, :logger, :cookie, :connection, :adapter
44
+ attr_reader :url, :username, :password, :logger, :cookie, :connection, :adapter, :ssl
45
45
 
46
- def initialize(url:, username:, password:, logger: true, adapter: Faraday.default_adapter)
46
+ def initialize(url:, username:, password:, logger: true, adapter: Faraday.default_adapter, ssl: nil)
47
47
  @url = "#{url}/api/"
48
48
  @username = username
49
49
  @password = password
50
50
  @logger = logger
51
51
  @adapter = adapter
52
+ @ssl = ssl
52
53
  @cookie = auth['set-cookie']
53
54
  end
54
55
 
@@ -103,7 +104,14 @@ module RockRMS
103
104
 
104
105
  headers['Cookie'] = cookie if cookie
105
106
 
106
- Faraday.new(url: url, headers: headers) do |conn|
107
+ client_opts = {
108
+ url: url,
109
+ headers: headers
110
+ }
111
+
112
+ client_opts[:ssl] = ssl if ssl
113
+
114
+ Faraday.new(client_opts) do |conn|
107
115
  conn.request :json
108
116
  conn.response :logger if logger
109
117
  conn.response :oj
@@ -35,7 +35,7 @@ module RockRMS
35
35
  )
36
36
  end
37
37
 
38
- def create_person(first_name:, last_name:, email:, connection_status_value_id: nil, record_status_value_id: nil)
38
+ def create_person(first_name:, last_name:, email:, connection_status_value_id: nil, record_status_value_id: nil, record_type_value_id: 1)
39
39
  options = {
40
40
  'IsSystem' => false,
41
41
  'FirstName' => first_name,
@@ -43,8 +43,13 @@ module RockRMS
43
43
  'Email' => email,
44
44
  'Gender' => 1,
45
45
  'ConnectionStatusValueId' => connection_status_value_id,
46
- 'RecordStatusValueId' => record_status_value_id
46
+ 'RecordStatusValueId' => record_status_value_id,
47
+ 'RecordTypeValueId' => record_type_value_id,
47
48
  }
49
+
50
+ # RecordTypeValueId 1 = Person
51
+ # RecordTypeValueId 2 = Business
52
+
48
53
  post(people_path, options)
49
54
  end
50
55
 
@@ -17,6 +17,7 @@ module RockRMS
17
17
  foreign_key: nil,
18
18
  frequency:,
19
19
  funds:,
20
+ end_date: nil,
20
21
  gateway_id: nil,
21
22
  gateway_schedule_id: nil,
22
23
  next_payment_date:,
@@ -40,6 +41,9 @@ module RockRMS
40
41
  'SourceTypeValueId' => source_type_id,
41
42
  'ForeignKey' => foreign_key
42
43
  }
44
+
45
+ options['EndDate'] = end_date if end_date
46
+
43
47
  post(recurring_donation_path, options)
44
48
  end
45
49
 
@@ -48,12 +52,16 @@ module RockRMS
48
52
  next_payment_date:,
49
53
  transaction_code: nil,
50
54
  payment_detail_id: nil,
51
- active: nil
55
+ active: nil,
56
+ frequency: nil,
57
+ end_date: nil
52
58
  )
53
59
  options = { 'NextPaymentDate' => next_payment_date }
54
60
  options['FinancialPaymentDetailId'] = payment_detail_id if payment_detail_id
55
61
  options['TransactionCode'] = transaction_code if transaction_code
56
62
  options['IsActive'] = active if !active.nil?
63
+ options['TransactionFrequencyValueId'] = RecurringFrequencies::RECURRING_FREQUENCIES[frequency] if !frequency.nil?
64
+ options['EndDate'] = end_date if end_date
57
65
 
58
66
  patch(recurring_donation_path(id), options)
59
67
  end
@@ -7,6 +7,7 @@ module RockRMS
7
7
  financial_gateway_id: 'FinancialGatewayId',
8
8
  foreign_key: 'ForeignKey',
9
9
  frequency: 'TransactionFrequencyValueId',
10
+ end_date: 'EndDate',
10
11
  gateway_schedule_id: 'GatewayScheduleId',
11
12
  next_payment_date: 'NextPaymentDate',
12
13
  payment_details: 'FinancialPaymentDetail',
@@ -1,3 +1,3 @@
1
1
  module RockRMS
2
- VERSION = '5.12.0'.freeze
2
+ VERSION = '5.16.0'.freeze
3
3
  end
@@ -20,6 +20,7 @@ RSpec.describe RockRMS::Response::RecurringDonation, type: :model do
20
20
  financial_gateway_id
21
21
  foreign_key
22
22
  frequency
23
+ end_date
23
24
  gateway_schedule_id
24
25
  next_payment_date
25
26
  payment_details
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.12.0
4
+ version: 5.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Brooks
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-01 00:00:00.000000000 Z
11
+ date: 2022-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -339,7 +339,7 @@ homepage: https://github.com/taylorbrooks/rock_rms
339
339
  licenses:
340
340
  - MIT
341
341
  metadata: {}
342
- post_install_message:
342
+ post_install_message:
343
343
  rdoc_options: []
344
344
  require_paths:
345
345
  - lib
@@ -355,7 +355,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
355
355
  version: '0'
356
356
  requirements: []
357
357
  rubygems_version: 3.1.4
358
- signing_key:
358
+ signing_key:
359
359
  specification_version: 4
360
360
  summary: A Ruby wrapper for the Rock RMS API
361
361
  test_files: []