tessitura_rest 1.0.0 → 1.1.3

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: b1c0cb85f1eabd6b4fe356d497a173d7600f968c13008bf6cee84fa7eb12eff0
4
- data.tar.gz: 782de30cd862804e7da8179e7c26852ee67eee9400a69a76a92bbce0984a8f4c
3
+ metadata.gz: ee92b87e4fc495f8c859ae916e74e7e1f3e2f9c9c45ab33a06d77b38c2c9cbd5
4
+ data.tar.gz: f64ae16839e866e52cf364d3c71a23a22debdf466fde19be2fc9c582282a26e0
5
5
  SHA512:
6
- metadata.gz: 938a9745855bf0cb45589fa64a712e5fedf1e1c7e713f559a99ac50344e984e3d9e8ea2b2dea981dba0ec266d08631a460d86dff54ec0e4095b4b159aefb636e
7
- data.tar.gz: 6482c7ecb1ca489cd3aaa4df17758d299123de07eb54f23a04f5e1432d3a4128284cd77e11e26425c5a1ea78d287493ea3f8167698313e5825eddc543b00a952
6
+ metadata.gz: 5b26c32b0f94e7d65b092638d73241c1f41a8e450d7ba514922d2c05356d8c16652e8fb49f63d047a6ab81823a1a1b814412fce963f7346340c3a7d1339612e4
7
+ data.tar.gz: c4bd24938bddae4a93f515341f367d5063b13e51d5b099a0b67e3d3e6485e21a2d0e2b47ca38c28a1677f94a62fdf2535bf6f4985165f4ef74300cfede8e031c
data/README.md CHANGED
@@ -46,7 +46,6 @@ followed by the method and arguments you would like to use.
46
46
  * USERNAME # the username to authenticate to your TessituraRest REST instance
47
47
  * PASSWORD # the password to authenticate to your TessituraRest REST instance
48
48
  * WEB_CART_TEXT # the ID to the pricing rule you have setup for Cart
49
- * ORDER_CONFIRM_TEXT # the ID to the pricing rule you have setup for Order Confirmations
50
49
  * SESSION_KEY # an existing session key in your TessituraRest instance
51
50
  * EMAIL # an email tied to an existing web login in your TessituraRest instance
52
51
  * CONSTITUENT_ID # an active constituent in your TessituraRest instance
@@ -105,6 +105,7 @@ module Constituents
105
105
 
106
106
  def update_household(params, current, options={})
107
107
  constituents = current['Affiliates'].map{|c| c['RelatedConstituentId']}
108
+ update = []
108
109
  constituents.each_with_index do |constituent, i|
109
110
  snapshot = get_constituent_snapshot(constituent)
110
111
  parameters =
@@ -133,8 +134,9 @@ module Constituents
133
134
  }
134
135
  options.merge!(basic_auth: @auth, headers: @headers)
135
136
  options.merge!(:body => parameters)
136
- self.class.put(base_api_endpoint("CRM/Constituents/#{constituent}"), options)
137
+ update << self.class.put(base_api_endpoint("CRM/Constituents/#{constituent}"), options)
137
138
  end
139
+ update.last if update.present?
138
140
  end
139
141
 
140
142
 
@@ -1,32 +1,20 @@
1
1
  module LocalProcedure
2
-
3
- def execute_local_procedure(id, params = "", options={})
4
- parameters =
5
- {
6
- 'ProcedureId' => id.to_s,
7
- 'Parameters' => params
8
- }
9
- options.merge!(basic_auth: @auth, headers: @headers)
10
- options.merge!(:body => parameters.to_json, :headers => {'Content-Type' => 'application/json'})
11
- self.class.post(base_api_endpoint('Custom/Execute'), options)
12
- end
13
-
14
- def execute_local_procedure_v2(id, params = [], options={})
2
+ def execute_local_procedure_v2(id, params = [], options = {})
15
3
  parameters =
16
4
  {
17
- 'ProcedureId' => id.to_s,
18
- 'ParameterValues' => params
5
+ 'ProcedureId' => id.to_s,
6
+ 'ParameterValues' => params,
19
7
  }
20
8
  options.merge!(basic_auth: @auth, headers: @headers)
21
9
  options.merge!(:body => parameters.to_json, :headers => {'Content-Type' => 'application/json'})
22
10
  self.class.post(base_api_endpoint('Custom/Execute'), options)
23
11
  end
24
12
 
25
- def execute_local_procedure_with_multiple_result_sets(id, parameter_values= [], options={})
13
+ def execute_local_procedure_with_multiple_result_sets(id, parameter_values = [], options = {})
26
14
  parameters =
27
15
  {
28
- 'ProcedureId' => id.to_s,
29
- 'ParameterValues' => parameter_values
16
+ 'ProcedureId' => id.to_s,
17
+ 'ParameterValues' => parameter_values,
30
18
  }
31
19
  options.merge!(basic_auth: @auth, headers: @headers)
32
20
  options.merge!(:body => parameters.to_json, :headers => {'Content-Type' => 'application/json'})
@@ -0,0 +1,7 @@
1
+ module Payments
2
+ def get_on_account_balance(current_user, payment_method_id, options={})
3
+ options.merge!(basic_auth: @auth, headers: @headers)
4
+ response = self.class.get(base_api_endpoint("TXN/Payments/OnAccount?constituentId=#{current_user}&paymentMethodId=#{payment_method_id}"), options)
5
+ JSON.parse(response.body)
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  class TessituraRest
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.1.3'.freeze
3
3
  end
@@ -14,11 +14,6 @@ module Cart
14
14
  options.merge!(basic_auth: @auth, headers: @headers)
15
15
  self.class.delete(base_api_endpoint("Web/Cart/#{session_key}"), options)
16
16
  end
17
-
18
- def order_confirm_text(session_key, options={})
19
- options.merge!(basic_auth: @auth, headers: @headers)
20
- self.class.get(base_api_endpoint("Web/Cart/#{session_key}?messageTypes=#{ENV['ORDER_CONFIRM_TEXT']}&savedCart=true"), options)
21
- end
22
17
 
23
18
  def change_mode_of_sale(session_key, code, options={})
24
19
  parameters =
@@ -94,6 +89,17 @@ module Cart
94
89
  self.class.post(base_api_endpoint("Web/Cart/#{session_key}/OnAccount"), options)
95
90
  end
96
91
 
92
+ def apply_on_account(session_key, amount, payment_method_id, options={})
93
+ parameters =
94
+ {
95
+ 'Amount': amount,
96
+ "PaymentMethodId": payment_method_id
97
+ }
98
+ options.merge!(basic_auth: @auth, headers: @headers)
99
+ options.merge!(:body => parameters.to_json, :headers => {'Content-Type' => 'application/json'})
100
+ self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Payments/OnAccount"), options)
101
+ end
102
+
97
103
  def remove_on_account(session_key, payment_id, options={})
98
104
  options.merge!(basic_auth: @auth, headers: @headers)
99
105
  self.class.delete(base_api_endpoint("Web/Cart/#{session_key}/OnAccount/#{payment_id}"), options)
@@ -18,22 +18,22 @@ module Session
18
18
  JSON.parse(response.body)
19
19
  end
20
20
 
21
+ def get_expiration(key, options={})
22
+ options.merge!(basic_auth: @auth, headers: @headers)
23
+ response = self.class.get(base_api_endpoint("Web/Session/#{key}/Expiration"), options)
24
+ JSON.parse(response.body)
25
+ end
26
+
21
27
  def transfer_session(session_key, new_session_key, options={})
22
28
  parameters =
23
- {
24
- 'NewSessionKey': new_session_key,
25
- }
29
+ {
30
+ 'NewSessionKey': new_session_key,
31
+ }
26
32
  options.merge!(basic_auth: @auth, headers: @headers)
27
33
  options.merge!(body: parameters)
28
34
  self.class.post(base_api_endpoint("Web/Session/#{session_key}/Transfer"), options)
29
35
  end
30
36
 
31
- def get_expiration(key, options={})
32
- options.merge!(basic_auth: @auth, headers: @headers)
33
- response = self.class.get(base_api_endpoint("Web/Session/#{key}/Expiration"), options)
34
- JSON.parse(response.body)
35
- end
36
-
37
37
  def get_variables(key, options={})
38
38
  options.merge!(basic_auth: @auth, headers: @headers)
39
39
  response = self.class.get(base_api_endpoint("Web/Session/#{key}/Variables"), options)
@@ -24,6 +24,7 @@ class TessituraRest
24
24
  include Login
25
25
  include Orders
26
26
  include Package
27
+ include Payments
27
28
  include PaymentPlanExtension
28
29
  include PerformanceExtension
29
30
  include PerformancePackageModeOfSales
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tessitura_rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brittany Martin, Danielle Greaves, Craig Donavin, Patrick FitzGerald
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-21 00:00:00.000000000 Z
11
+ date: 2021-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -152,6 +152,7 @@ files:
152
152
  - lib/tessitura_rest/security/security_user_groups.rb
153
153
  - lib/tessitura_rest/txn/orders.rb
154
154
  - lib/tessitura_rest/txn/package.rb
155
+ - lib/tessitura_rest/txn/payments.rb
155
156
  - lib/tessitura_rest/txn/performance_extension.rb
156
157
  - lib/tessitura_rest/txn/performance_package_mode_of_sales.rb
157
158
  - lib/tessitura_rest/txn/price_types.rb
@@ -186,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
186
187
  - !ruby/object:Gem::Version
187
188
  version: '0'
188
189
  requirements: []
189
- rubygems_version: 3.2.16
190
+ rubygems_version: 3.2.15
190
191
  signing_key:
191
192
  specification_version: 4
192
193
  summary: Rest API Endpoint for the Tessitura Rest API (v14+).