rock_rms 5.11.0 → 5.15.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: 61f5253a37866cd7066b265bd4fd005abc144f9f332b6687359ec814b6a9d8d8
4
- data.tar.gz: da5df5d17ce802f4a1d805852d972f31b3f6a80a5f995b308b1d3d5f3a676c73
3
+ metadata.gz: 38a5f0a7bc780afd9b9b3115d567198b1d44314f3d66ba51ec3d8102ea8a1b89
4
+ data.tar.gz: d741e1c8f38e8a58f32155932cc2f0e6b385b66d34fe44b58e270b77019246ca
5
5
  SHA512:
6
- metadata.gz: d7897dfc323efcacecf20d7c226fe3a45150afb4578411c2a0657bb7edaa9e7b4b8654b8e768dfb2bcaeb77da7e91e6c55165e99c6108e508e46ea0ae1a9c3df
7
- data.tar.gz: d4bfc24c2617b35dd8f905adcdd13ebcc4f92cb6d31b75cff59dc07b8e2e84da0d9675d42414d681093c572b89f6a3100c5c5cf963fe6cea87d938ab8ff0678d
6
+ metadata.gz: c8d6f9707b40172016072805389d42a675e6ea250be0d8dc0bb9db9a202ef0192a78aec34af59789dddc2e45391c79a3cce6de2f06e0b03210940eac4e536ff2
7
+ data.tar.gz: 3bb11888fde235dacff1b9fa590217186fbacb4aca7579de2f7c055114d8fb4160e8ef16e2138e2654809733ab72b91f164b6ccc911dfa7bd4a1c8c6243afab5
@@ -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
@@ -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
@@ -45,7 +45,9 @@ module RockRMS
45
45
  apportion_refund_amount_over_accounts(details, transaction_amount, refund_amount).map do |dt|
46
46
  {
47
47
  'Amount' => -dt[:amount],
48
- 'AccountId' => dt[:fund_id]
48
+ 'AccountId' => dt[:fund_id],
49
+ 'EntityTypeId' => dt[:entity_type_id],
50
+ 'EntityId' => dt[:entity_id]
49
51
  }
50
52
  end
51
53
  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.11.0'.freeze
2
+ VERSION = '5.15.0'.freeze
3
3
  end
@@ -54,7 +54,20 @@ RSpec.describe RockRMS::Client::Refund, type: :model do
54
54
  'FinancialGatewayId' => nil,
55
55
  'FinancialPaymentDetailId' => 156,
56
56
  'TransactionDateTime' => '2018-02-01',
57
- 'TransactionDetails' => [{"Amount"=>-10.0, "AccountId"=>23}, {"Amount"=>-90.0, "AccountId"=>24}],
57
+ 'TransactionDetails' => [
58
+ {
59
+ "Amount"=>-10.0,
60
+ "AccountId"=>23,
61
+ "EntityTypeId" => nil,
62
+ "EntityId" => nil
63
+ },
64
+ {
65
+ "Amount"=> -90.0,
66
+ "AccountId"=>24,
67
+ "EntityTypeId" => nil,
68
+ "EntityId" => nil
69
+ }
70
+ ],
58
71
  'TransactionTypeValueId' => 53,
59
72
  'TransactionCode' => nil
60
73
  }
@@ -93,7 +106,20 @@ RSpec.describe RockRMS::Client::Refund, type: :model do
93
106
  'FinancialGatewayId' => nil,
94
107
  'FinancialPaymentDetailId' => 156,
95
108
  'TransactionDateTime' => '2018-02-01',
96
- 'TransactionDetails' => [{"Amount"=>-7.56, "AccountId"=>23}, {"Amount"=>-67.99, "AccountId"=>24}],
109
+ 'TransactionDetails' => [
110
+ {
111
+ "Amount"=>-7.56,
112
+ "AccountId"=>23,
113
+ "EntityTypeId" => nil,
114
+ "EntityId" => nil
115
+ },
116
+ {
117
+ "Amount"=>-67.99,
118
+ "AccountId"=>24,
119
+ "EntityTypeId" => nil,
120
+ "EntityId" => nil
121
+ }
122
+ ],
97
123
  'TransactionTypeValueId' => 53,
98
124
  'TransactionCode' => nil
99
125
  }
@@ -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.11.0
4
+ version: 5.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: 2021-05-05 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