tessitura_rest 0.3.15 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tessitura_rest.rb +4 -1
  3. data/lib/tessitura_rest/crm/accounts.rb +1 -1
  4. data/lib/tessitura_rest/crm/actions.rb +3 -3
  5. data/lib/tessitura_rest/crm/addresses.rb +3 -3
  6. data/lib/tessitura_rest/crm/attributes.rb +1 -1
  7. data/lib/tessitura_rest/crm/constituencies.rb +3 -3
  8. data/lib/tessitura_rest/crm/issues.rb +3 -3
  9. data/lib/tessitura_rest/crm/phones.rb +2 -2
  10. data/lib/tessitura_rest/crm/web_logins.rb +1 -1
  11. data/lib/tessitura_rest/custom/email.rb +1 -1
  12. data/lib/tessitura_rest/custom/local_procedure.rb +1 -1
  13. data/lib/tessitura_rest/diagnostics/diagnostics.rb +1 -2
  14. data/lib/tessitura_rest/finance/gift_certificates.rb +1 -1
  15. data/lib/tessitura_rest/reference_data/countries.rb +1 -1
  16. data/lib/tessitura_rest/reference_data/sections.rb +1 -1
  17. data/lib/tessitura_rest/reference_data/states.rb +1 -1
  18. data/lib/tessitura_rest/security/security_user_groups.rb +1 -1
  19. data/lib/tessitura_rest/txn/orders.rb +1 -1
  20. data/lib/tessitura_rest/txn/package.rb +5 -5
  21. data/lib/tessitura_rest/txn/performance_extension.rb +5 -5
  22. data/lib/tessitura_rest/txn/price_types.rb +1 -1
  23. data/lib/tessitura_rest/txn/product_keywords.rb +1 -1
  24. data/lib/tessitura_rest/txn/production_extension.rb +2 -2
  25. data/lib/tessitura_rest/txn/production_season.rb +2 -2
  26. data/lib/tessitura_rest/txn/web_contents.rb +1 -1
  27. data/lib/tessitura_rest/version.rb +1 -1
  28. data/lib/tessitura_rest/web/cart.rb +20 -20
  29. data/lib/tessitura_rest/web/login.rb +3 -3
  30. data/lib/tessitura_rest/web/payment_plan_extension.rb +3 -3
  31. data/lib/tessitura_rest/web/session.rb +8 -8
  32. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ebd57c3c95c1a48008c3fec8a2aa23e43af7616f8b008e84707b55e5bf0c7a85
4
- data.tar.gz: 44df404b2d403b8debe5a8949168379efa1fe381949e7a3f47e552cfa2004d4a
3
+ metadata.gz: 06c7cc2251d276257a1980b96926d02f2458a343842851f67a8d896f79cd5bfb
4
+ data.tar.gz: c5076d27c153ead658379ad7b87d30848bd58bf4899be22401480bf4ba6070eb
5
5
  SHA512:
6
- metadata.gz: 3ad93041fa96ed9b769895ccc9ecaaaf1bb22e65f7b4b9c4f838c734149e261b4418c93eaa65e6671000fbdaf4434082ccaff7718571295144176d201c05457e
7
- data.tar.gz: 79031c304e78b99685807a112a22e958e85e8e6a7dcb5f994a71c9affa9351138fabdf57ddb42d2c71e2fc92c8cc2cdff0fcbc031a2f25d7786c9851c3f272cc
6
+ metadata.gz: da0898ab130ac5b4693c511d1ac55bc90abf2d99f0f7a27c851b0db609f66b7a56f7be17b0460927c945dd8c7cfe8bd1c0fc89242aaa0d084cceb637ccdf5bae
7
+ data.tar.gz: 816604666f9b22f563acdc3a23adc5048918c18e424c903b57bb52fa204f8bf3cdd0e66cbb3bc2f5d392b4ed61485976ebe2ae774358576f933d2da43da5d5fb
@@ -36,7 +36,10 @@ class TessituraRest
36
36
  include WebLogins
37
37
 
38
38
  def initialize(options={})
39
- @auth = {:username => ENV['TESSITURA_USERNAME'], :password => ENV['TESSITURA_PASSWORD']}
39
+ @auth = { username: ENV['TESSITURA_USERNAME'],
40
+ password: ENV['TESSITURA_PASSWORD'] }
41
+ @headers = { 'Content-Type': 'application/json',
42
+ 'Accept': 'application/json' }
40
43
  end
41
44
 
42
45
  def base_api_endpoint(end_point)
@@ -1,7 +1,7 @@
1
1
  module Accounts
2
2
 
3
3
  def get_all_accounts(constituent_id, inactive=false, include_affiliate=false, options={})
4
- options.merge!({:basic_auth => @auth})
4
+ options.merge!(basic_auth: @auth, headers: @headers)
5
5
  response = self.class.get(base_api_endpoint("CRM/Accounts?constituentId=#{constituent_id}&includeInactive=#{inactive}&includeAffiliates=#{include_affiliate}"), options)
6
6
  JSON.parse(response.body)
7
7
  end
@@ -1,13 +1,13 @@
1
1
  module Actions
2
2
 
3
3
  def get_action(id, options={})
4
- options.merge!({:basic_auth => @auth})
4
+ options.merge!(basic_auth: @auth, headers: @headers)
5
5
  response = self.class.get(base_api_endpoint("CRM/Actions/#{id}"), options)
6
6
  JSON.parse(response.body)
7
7
  end
8
8
 
9
9
  def get_actions(constituent_id, issue_id, options={})
10
- options.merge!({:basic_auth => @auth})
10
+ options.merge!(basic_auth: @auth, headers: @headers)
11
11
  response = self.class.get(base_api_endpoint("CRM/Actions?constituentId=#{constituent_id}&issueId=#{issue_id}"), options)
12
12
  JSON.parse(response.body)
13
13
  end
@@ -27,7 +27,7 @@ module Actions
27
27
  'Notes': notes,
28
28
  'Resolved': true,
29
29
  }
30
- options.merge!({:basic_auth => @auth})
30
+ options.merge!(basic_auth: @auth, headers: @headers)
31
31
  options.merge!(:body => parameters)
32
32
  response = self.class.post(base_api_endpoint('CRM/Actions'), options)
33
33
  JSON.parse(response.body)
@@ -1,13 +1,13 @@
1
1
  module Addresses
2
2
 
3
3
  def get_address(address_id, options={})
4
- options.merge!({:basic_auth => @auth})
4
+ options.merge!(basic_auth: @auth, headers: @headers)
5
5
  response = self.class.get(base_api_endpoint("CRM/Addresses/#{address_id}"), options)
6
6
  JSON.parse(response.body)
7
7
  end
8
8
 
9
9
  def get_all_addresses(constituent_id, inactive=false, include_affiliate=false, primary_only=false, include_from_affiliations=false, options={})
10
- options.merge!({:basic_auth => @auth})
10
+ options.merge!(basic_auth: @auth, headers: @headers)
11
11
  response = self.class.get(base_api_endpoint("CRM/Addresses?constituentId=#{constituent_id}&
12
12
  includeInactive=#{inactive}&includeAffiliates=#{include_affiliate}
13
13
  &primaryOnly=#{primary_only}&includeFromAffiliations=
@@ -42,7 +42,7 @@ module Addresses
42
42
  'Street1': street1,
43
43
  'Street2': street2
44
44
  }
45
- options.merge!({:basic_auth => @auth})
45
+ options.merge!(basic_auth: @auth, headers: @headers)
46
46
  options.merge!(:body => parameters)
47
47
  response = self.class.put(base_api_endpoint("CRM/Addresses/#{id}"), options)
48
48
  JSON.parse(response.body)
@@ -12,7 +12,7 @@ module Attributes
12
12
  'Value'=> value,
13
13
  'UpdatedDateTime'=> DateTime.now.to_s
14
14
  }
15
- options.merge!({:basic_auth => @auth})
15
+ options.merge!(basic_auth: @auth, headers: @headers)
16
16
  options.merge!(:body => parameters)
17
17
  response = self.class.post(base_api_endpoint('CRM/Attributes'), options)
18
18
  JSON.parse(response.body)
@@ -1,13 +1,13 @@
1
1
  module Constituencies
2
2
 
3
3
  def get_constituencies(id, options={})
4
- options.merge!({:basic_auth => @auth})
4
+ options.merge!(basic_auth: @auth, headers: @headers)
5
5
  response = self.class.get(base_api_endpoint("CRM/Constituencies?constituentId=#{id}"), options)
6
6
  JSON.parse(response.body)
7
7
  end
8
8
 
9
9
  def get_constituent_snapshot(id, options={})
10
- options.merge!({:basic_auth => @auth})
10
+ options.merge!(basic_auth: @auth, headers: @headers)
11
11
  response = self.class.get(base_api_endpoint("CRM/Constituents/#{id}/Snapshot"), options)
12
12
  JSON.parse(response.body)
13
13
  end
@@ -22,7 +22,7 @@ module Constituencies
22
22
  'Id': id
23
23
  }
24
24
  }
25
- options.merge!({:basic_auth => @auth})
25
+ options.merge!(basic_auth: @auth, headers: @headers)
26
26
  options.merge!(:body => parameters)
27
27
  response = self.class.post(base_api_endpoint('CRM/Constituencies'), options)
28
28
  end
@@ -1,13 +1,13 @@
1
1
  module Issues
2
2
 
3
3
  def get_issue(id, options={})
4
- options.merge!({:basic_auth => @auth})
4
+ options.merge!(basic_auth: @auth, headers: @headers)
5
5
  response = self.class.get(base_api_endpoint("CRM/Issues/#{id}"), options)
6
6
  JSON.parse(response.body)
7
7
  end
8
8
 
9
9
  def get_issues(constituent_id, start_date = Date.today, end_date = Date.today + 365, resolved = false, options={})
10
- options.merge!({:basic_auth => @auth})
10
+ options.merge!(basic_auth: @auth, headers: @headers)
11
11
  response = self.class.get(base_api_endpoint("CRM/Issues?constituentId=#{constituent_id}"), options)
12
12
  JSON.parse(response.body)
13
13
  end
@@ -27,7 +27,7 @@ module Issues
27
27
  'Notes': notes,
28
28
  'HasReminder': false
29
29
  }
30
- options.merge!({:basic_auth => @auth})
30
+ options.merge!(basic_auth: @auth, headers: @headers)
31
31
  options.merge!(:body => parameters)
32
32
  response = self.class.post(base_api_endpoint('CRM/Issues'), options)
33
33
  JSON.parse(response.body)
@@ -13,7 +13,7 @@ module Phones
13
13
  'Inactive': false
14
14
  }
15
15
  }
16
- options.merge!({:basic_auth => @auth})
16
+ options.merge!(basic_auth: @auth, headers: @headers)
17
17
  options.merge!(:body => parameters)
18
18
  response = self.class.post(base_api_endpoint('CRM/Phones'), options)
19
19
  JSON.parse(response.body)
@@ -32,7 +32,7 @@ module Phones
32
32
  'Inactive': false
33
33
  }
34
34
  }
35
- options.merge!({:basic_auth => @auth})
35
+ options.merge!(basic_auth: @auth, headers: @headers)
36
36
  options.merge!(:body => parameters)
37
37
  response = self.class.post(base_api_endpoint('CRM/Phones'), options)
38
38
  JSON.parse(response.body)
@@ -1,7 +1,7 @@
1
1
  module WebLogins
2
2
 
3
3
  def get_web_login(email, login_type, options={})
4
- options.merge!({:basic_auth => @auth})
4
+ options.merge!(basic_auth: @auth, headers: @headers)
5
5
  response = self.class.get(base_api_endpoint("CRM/WebLogins/Search?emailAddress=#{email}&loginTypeId=#{login_type}"), options)
6
6
  JSON.parse(response.body)
7
7
  end
@@ -9,7 +9,7 @@ module Email
9
9
  'EmailAddress': email,
10
10
  'EmailProfileId': profile_id
11
11
  }
12
- options.merge!({:basic_auth => @auth})
12
+ options.merge!(basic_auth: @auth, headers: @headers)
13
13
  options.merge!(:body => parameters.to_json, :headers => {'Content-Type' => 'application/json'})
14
14
  post = self.class.post(base_api_endpoint("Emails/LoginCredentials/#{login_id.first['Id']}/Send"), options)
15
15
  post.success?
@@ -6,7 +6,7 @@ module LocalProcedure
6
6
  'ProcedureId' => id.to_s,
7
7
  'Parameters' => params
8
8
  }
9
- options.merge!({:basic_auth => @auth})
9
+ options.merge!(basic_auth: @auth, headers: @headers)
10
10
  options.merge!(:body => parameters.to_json, :headers => {'Content-Type' => 'application/json'})
11
11
  self.class.post(base_api_endpoint('Custom/Execute'), options)
12
12
  end
@@ -1,7 +1,6 @@
1
1
  module Diagnostics
2
-
3
2
  def diagnostics_status(options={})
4
- options.merge!({:basic_auth => @auth})
3
+ options.merge!(basic_auth: @auth, headers: @headers)
5
4
  self.class.get(base_api_endpoint('Diagnostics/Status'), options)
6
5
  end
7
6
  end
@@ -1,7 +1,7 @@
1
1
  module GiftCertificates
2
2
 
3
3
  def get_gift_certificate_info (gift_certificate_number, options={})
4
- options.merge!({:basic_auth => @auth})
4
+ options.merge!(basic_auth: @auth, headers: @headers)
5
5
  response = self.class.get(base_api_endpoint("Finance/GiftCertificates/#{gift_certificate_number}"), options)
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module Countries
2
2
 
3
3
  def get_all_countries (options={})
4
- options.merge!({:basic_auth => @auth})
4
+ options.merge!(basic_auth: @auth, headers: @headers)
5
5
  response = self.class.get(base_api_endpoint("ReferenceData/Countries"), options)
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module Sections
2
2
 
3
3
  def get_section (id, options={})
4
- options.merge!({:basic_auth => @auth})
4
+ options.merge!(basic_auth: @auth, headers: @headers)
5
5
  response = self.class.get(base_api_endpoint("ReferenceData/Sections/#{id}"), options)
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module States
2
2
 
3
3
  def get_all_states (options={})
4
- options.merge!({:basic_auth => @auth})
4
+ options.merge!(basic_auth: @auth, headers: @headers)
5
5
  response = self.class.get(base_api_endpoint("ReferenceData/States"), options)
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module SecurityUserGroups
2
2
 
3
3
  def security_user_groups(login, options={})
4
- options.merge!({:basic_auth => @auth})
4
+ options.merge!(basic_auth: @auth, headers: @headers)
5
5
  response = self.class.get(base_api_endpoint("Security/UserGroups/Default?userName=#{login}"), options)
6
6
  JSON.parse(response.body)["UserGroup"]
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module Orders
2
2
 
3
3
  def get_products_view(id, options={})
4
- options.merge!({:basic_auth => @auth})
4
+ options.merge!(basic_auth: @auth, headers: @headers)
5
5
  response = self.class.get(base_api_endpoint("TXN/Orders/#{id}/ProductsView"), options)
6
6
  JSON.parse(response.body)
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module Package
2
2
 
3
3
  def get_package_by_id(id, options={})
4
- options.merge!({:basic_auth => @auth})
4
+ options.merge!(basic_auth: @auth, headers: @headers)
5
5
  response = self.class.get(base_api_endpoint("TXN/Packages/#{id}"), options)
6
6
  JSON.parse(response.body)
7
7
  end
@@ -12,26 +12,26 @@ module Package
12
12
  'PerformanceStartDate': start_date,
13
13
  'PerformanceEndDate': end_date
14
14
  }
15
- options.merge!({:basic_auth => @auth})
15
+ options.merge!(basic_auth: @auth, headers: @headers)
16
16
  options.merge!(:body => parameters)
17
17
  response = self.class.post(base_api_endpoint('TXN/Packages/Search'), options)
18
18
 
19
19
  end
20
20
 
21
21
  def get_package_detail(id, mode_of_sale, options={})
22
- options.merge!({:basic_auth => @auth})
22
+ options.merge!(basic_auth: @auth, headers: @headers)
23
23
  response = self.class.get(base_api_endpoint("TXN/Packages/#{id}/Details?modeOfSaleId=#{mode_of_sale}"), options)
24
24
  JSON.parse(response.body)
25
25
  end
26
26
 
27
27
  def get_package_prices(id, mode_of_sale, options={})
28
- options.merge!({:basic_auth => @auth})
28
+ options.merge!(basic_auth: @auth, headers: @headers)
29
29
  response = self.class.get(base_api_endpoint("TXN/Packages/#{id}/Prices?modeOfSaleId=#{mode_of_sale}"), options)
30
30
  JSON.parse(response.body)
31
31
  end
32
32
 
33
33
  def get_package_performance_groups(id, mode_of_sale=nil, options={})
34
- options.merge!({:basic_auth => @auth})
34
+ options.merge!(basic_auth: @auth, headers: @headers)
35
35
  response = self.class.get(base_api_endpoint("TXN/Packages/#{id}/PerformanceGroups?modeOfSaleId=#{mode_of_sale}"), options)
36
36
  JSON.parse(response.body)
37
37
  end
@@ -5,31 +5,31 @@ module PerformanceExtension
5
5
  {
6
6
  'ProductionSeasonIds': ids
7
7
  }
8
- options.merge!({:basic_auth => @auth})
8
+ options.merge!(basic_auth: @auth, headers: @headers)
9
9
  options.merge!(:body => parameters)
10
10
  response = self.class.post(base_api_endpoint('TXN/Performances/Search'), options)
11
11
  end
12
12
 
13
13
  def get_performance_detail(id, options={})
14
- options.merge!({:basic_auth => @auth})
14
+ options.merge!(basic_auth: @auth, headers: @headers)
15
15
  response = self.class.get(base_api_endpoint("TXN/Performances?performanceIds=#{id}"), options)
16
16
  JSON.parse(response.body)
17
17
  end
18
18
 
19
19
  def get_performance_availability(ids, sections_ids=nil, options={})
20
- options.merge!({:basic_auth => @auth})
20
+ options.merge!(basic_auth: @auth, headers: @headers)
21
21
  response = self.class.get(base_api_endpoint("TXN/Performances/Zones?performanceIds=#{ids}&sectionIds=#{sections_ids}"), options)
22
22
  JSON.parse(response.body)
23
23
  end
24
24
 
25
25
  def get_performance_seats(id, mode_of_sale, constituent_id, options={})
26
- options.merge!({:basic_auth => @auth})
26
+ options.merge!(basic_auth: @auth, headers: @headers)
27
27
  response = self.class.get(base_api_endpoint("TXN/Performances/#{id}/Seats?modeOfSaleId=#{mode_of_sale}&constituentId=#{constituent_id}"), options)
28
28
  JSON.parse(response.body)
29
29
  end
30
30
 
31
31
  def get_performance_seat_summaries(id, options={})
32
- options.merge!({:basic_auth => @auth})
32
+ options.merge!(basic_auth: @auth, headers: @headers)
33
33
  response = self.class.get(base_api_endpoint("TXN/Performances/#{id}/Seats/Summary"), options)
34
34
  JSON.parse(response.body)
35
35
  end
@@ -1,7 +1,7 @@
1
1
  module PriceTypes
2
2
 
3
3
  def get_price_type(id, options={})
4
- options.merge!({:basic_auth => @auth})
4
+ options.merge!(basic_auth: @auth, headers: @headers)
5
5
  response = self.class.get(base_api_endpoint("TXN/PriceTypes/#{id}"), options)
6
6
  JSON.parse(response.body)
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module ProductKeywords
2
2
 
3
3
  def get_keywords(ids, options={})
4
- options.merge!({:basic_auth => @auth})
4
+ options.merge!(basic_auth: @auth, headers: @headers)
5
5
  response = self.class.get(base_api_endpoint("TXN/ProductKeywords?productionElementIds=#{ids}"), options)
6
6
  JSON.parse(response.body)
7
7
  end
@@ -1,13 +1,13 @@
1
1
  module ProductionExtension
2
2
 
3
3
  def get_production(id, options={})
4
- options.merge!({:basic_auth => @auth})
4
+ options.merge!(basic_auth: @auth, headers: @headers)
5
5
  response = self.class.get(base_api_endpoint("TXN/Productions/#{id}"), options)
6
6
  JSON.parse(response.body)
7
7
  end
8
8
 
9
9
  def get_production_details(id, options={})
10
- options.merge!({:basic_auth => @auth})
10
+ options.merge!(basic_auth: @auth, headers: @headers)
11
11
  response = self.class.get(base_api_endpoint("TXN/Productions/#{id}"), options)
12
12
  JSON.parse(response.body)
13
13
  end
@@ -1,7 +1,7 @@
1
1
  module ProductionSeason
2
2
 
3
3
  def get_production_season(id, options={})
4
- options.merge!({:basic_auth => @auth})
4
+ options.merge!(basic_auth: @auth, headers: @headers)
5
5
  response = self.class.get(base_api_endpoint("TXN/ProductionSeasons/#{id}"), options)
6
6
  JSON.parse(response.body)
7
7
  end
@@ -12,7 +12,7 @@ module ProductionSeason
12
12
  'PerformanceStartDate': start_date,
13
13
  'PerformanceEndDate': end_date
14
14
  }
15
- options.merge!({:basic_auth => @auth})
15
+ options.merge!(basic_auth: @auth, headers: @headers)
16
16
  options.merge!(:body => parameters)
17
17
  response = self.class.post(base_api_endpoint('TXN/ProductionSeasons/Search'), options)
18
18
  end
@@ -1,7 +1,7 @@
1
1
  module WebContents
2
2
 
3
3
  def get_web_contents(production_ids=nil, package_ids=nil, content_type_ids=nil, options={})
4
- options.merge!({:basic_auth => @auth})
4
+ options.merge!(basic_auth: @auth, headers: @headers)
5
5
  response = self.class.get(base_api_endpoint("TXN/WebContents?productionElementIds=#{production_ids}&packageIds=#{package_ids}&contentTypeIds=#{content_type_ids}"), options)
6
6
  JSON.parse(response.body)
7
7
  end
@@ -1,3 +1,3 @@
1
1
  class TessituraRest
2
- VERSION = "0.3.15"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -1,22 +1,22 @@
1
1
  module Cart
2
2
 
3
3
  def get_cart(session_key, options={})
4
- options.merge!({:basic_auth => @auth})
4
+ options.merge!(basic_auth: @auth, headers: @headers)
5
5
  self.class.get(base_api_endpoint("Web/Cart/#{session_key}"), options)
6
6
  end
7
7
 
8
8
  def empty_cart(session_key, options={})
9
- options.merge!({:basic_auth => @auth})
9
+ options.merge!(basic_auth: @auth, headers: @headers)
10
10
  self.class.delete(base_api_endpoint("Web/Cart/#{session_key}"), options)
11
11
  end
12
12
 
13
13
  def web_cart_text(session_key, options={})
14
- options.merge!({:basic_auth => @auth})
14
+ options.merge!(basic_auth: @auth, headers: @headers)
15
15
  self.class.get(base_api_endpoint("Web/Cart/#{session_key}/Messages?messageTypes=#{ENV['WEB_CART_TEXT']}&savedCart=false"), options)
16
16
  end
17
17
 
18
18
  def order_confirm_text(session_key, options={})
19
- options.merge!({:basic_auth => @auth})
19
+ options.merge!(basic_auth: @auth, headers: @headers)
20
20
  self.class.get(base_api_endpoint("Web/Cart/#{session_key}?messageTypes=#{ENV['ORDER_CONFIRM_TEXT']}&savedCart=true"), options)
21
21
  end
22
22
 
@@ -25,7 +25,7 @@ module Cart
25
25
  {
26
26
  'ModeOfSaleId': code
27
27
  }
28
- options.merge!({:basic_auth => @auth})
28
+ options.merge!(basic_auth: @auth, headers: @headers)
29
29
  options.merge!(:body => parameters)
30
30
  self.class.put(base_api_endpoint("Web/Cart/#{session_key}/Properties"), options)
31
31
  end
@@ -38,13 +38,13 @@ module Cart
38
38
  'Notes': notes,
39
39
  'Name': name
40
40
  }
41
- options.merge!({:basic_auth => @auth})
41
+ options.merge!(basic_auth: @auth, headers: @headers)
42
42
  options.merge!(:body => parameters)
43
43
  self.class.post(base_api_endpoint("Web/Cart/#{session_key}/GiftCertificates"), options)
44
44
  end
45
45
 
46
46
  def remove_gift_certificate(session_key, gift_certificate_number, options={})
47
- options.merge!({:basic_auth => @auth})
47
+ options.merge!(basic_auth: @auth, headers: @headers)
48
48
  self.class.delete(base_api_endpoint("Web/Cart/#{session_key}/GiftCertificates/#{gift_certificate_number}"), options)
49
49
  end
50
50
 
@@ -54,13 +54,13 @@ module Cart
54
54
  'Amount': amount,
55
55
  'GiftCertificateNumber': gift_certificate_number
56
56
  }
57
- options.merge!({:basic_auth => @auth})
57
+ options.merge!(basic_auth: @auth, headers: @headers)
58
58
  options.merge!(:body => parameters)
59
59
  self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Payments/GiftCertificate"), options)
60
60
  end
61
61
 
62
62
  def un_apply_gift_certificate(session_key, gift_certificate_number, options={})
63
- options.merge!({:basic_auth => @auth})
63
+ options.merge!(basic_auth: @auth, headers: @headers)
64
64
  self.class.delete(base_api_endpoint("Web/Cart/#{session_key}/Payments/GiftCertificate/#{gift_certificate_number}"), options)
65
65
  end
66
66
 
@@ -73,13 +73,13 @@ module Cart
73
73
  'Renew': renew,
74
74
  'MembershipLevelId': membership_level
75
75
  }
76
- options.merge!({:basic_auth => @auth})
76
+ options.merge!(basic_auth: @auth, headers: @headers)
77
77
  options.merge!(:body => parameters)
78
78
  self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Contributions"), options)
79
79
  end
80
80
 
81
81
  def remove_contribution(session_key, line_item_id, options={})
82
- options.merge!({:basic_auth => @auth})
82
+ options.merge!(basic_auth: @auth, headers: @headers)
83
83
  self.class.delete(base_api_endpoint("Web/Cart/#{session_key}/Contributions/#{line_item_id}"), options)
84
84
  end
85
85
 
@@ -89,23 +89,23 @@ module Cart
89
89
  'Amount': amount,
90
90
  "PaymentMethodId": payment_method_id
91
91
  }
92
- options.merge!({:basic_auth => @auth})
92
+ options.merge!(basic_auth: @auth, headers: @headers)
93
93
  options.merge!(:body => parameters)
94
94
  self.class.post(base_api_endpoint("Web/Cart/#{session_key}/OnAccount"), options)
95
95
  end
96
96
 
97
97
  def remove_on_account(session_key, payment_id, options={})
98
- options.merge!({:basic_auth => @auth})
98
+ options.merge!(basic_auth: @auth, headers: @headers)
99
99
  self.class.delete(base_api_endpoint("Web/Cart/#{session_key}/OnAccount/#{payment_id}"), options)
100
100
  end
101
101
 
102
102
  def get_properties(session_key, options={})
103
- options.merge!({:basic_auth => @auth})
103
+ options.merge!(basic_auth: @auth, headers: @headers)
104
104
  self.class.get(base_api_endpoint("Web/Cart/#{session_key}/Properties"), options)
105
105
  end
106
106
 
107
107
  def update_properties(session_key, category=0, solicitor='webapi', channel=0, options={})
108
- options.merge!({:basic_auth => @auth})
108
+ options.merge!(basic_auth: @auth, headers: @headers)
109
109
  parameters =
110
110
  {
111
111
  "Solicitor": solicitor,
@@ -117,7 +117,7 @@ module Cart
117
117
  end
118
118
 
119
119
  def update_source(session_key, source_no, solicitor='webapi', options={})
120
- options.merge!({:basic_auth => @auth})
120
+ options.merge!(basic_auth: @auth, headers: @headers)
121
121
  parameters =
122
122
  {
123
123
  "Solicitor": solicitor,
@@ -128,7 +128,7 @@ module Cart
128
128
  end
129
129
 
130
130
  def add_order_comment(session_key, notes, solicitor='webapi', options={})
131
- options.merge!({:basic_auth => @auth})
131
+ options.merge!(basic_auth: @auth, headers: @headers)
132
132
  parameters =
133
133
  {
134
134
  "Solicitor": solicitor,
@@ -149,7 +149,7 @@ module Cart
149
149
  "Unseated": unseated,
150
150
  "RequestedSeats": requested_seats
151
151
  }
152
- options.merge!({:basic_auth => @auth})
152
+ options.merge!(basic_auth: @auth, headers: @headers)
153
153
  options.merge!(:body => parameters)
154
154
  self.class.post(base_api_endpoint("/Web/Cart/#{session_key}/Tickets"), options)
155
155
  end
@@ -160,7 +160,7 @@ module Cart
160
160
  "TicketNumber": id,
161
161
  "ReturnOrDonate": return_or_donate
162
162
  }
163
- options.merge!({:basic_auth => @auth})
163
+ options.merge!(basic_auth: @auth, headers: @headers)
164
164
  options.merge!(:body => parameters)
165
165
  self.class.post(base_api_endpoint("/Web/Cart/#{session_key}/Tickets/Return"), options)
166
166
  end
@@ -173,7 +173,7 @@ module Cart
173
173
  "OrderId": order_id,
174
174
  "TicketDesignId": ticket_design
175
175
  }
176
- options.merge!({:basic_auth => @auth})
176
+ options.merge!(basic_auth: @auth, headers: @headers)
177
177
  options.merge!(:body => parameters)
178
178
  self.class.post(base_api_endpoint("/Web/Cart/#{session_key}/Print/TicketElements"), options)
179
179
  end
@@ -1,7 +1,7 @@
1
1
  module Login
2
2
 
3
3
  def with_user(ip_address, business_unit_id, options={})
4
- options.merge!({:basic_auth => @auth})
4
+ options.merge!(basic_auth: @auth, headers: @headers)
5
5
  response = self.class.get(base_api_endpoint('Web/Session/'), options)
6
6
  JSON.parse(response.body)
7
7
  end
@@ -13,7 +13,7 @@ module Login
13
13
  'LoginTypeId': login_type_id,
14
14
  'PromotionCode': promotion
15
15
  }
16
- options.merge!({:basic_auth => @auth})
16
+ options.merge!(basic_auth: @auth, headers: @headers)
17
17
  options.merge!(:body => parameters.to_json, :headers => {'Content-Type' => 'application/json'})
18
18
  post = self.class.post(base_api_endpoint("Web/Session/#{session_key}/Login/External"), options)
19
19
  post.success?
@@ -27,7 +27,7 @@ module Login
27
27
  'LoginTypeId': login_type_id,
28
28
  'PromotionCode': promotion
29
29
  }
30
- options.merge!({:basic_auth => @auth})
30
+ options.merge!(basic_auth: @auth, headers: @headers)
31
31
  options.merge!(:body => parameters.to_json, :headers => {'Content-Type' => 'application/json'})
32
32
  post = self.class.post(base_api_endpoint("Web/Session/#{session_key}/Login/Token"), options)
33
33
  post.success?
@@ -8,7 +8,7 @@ module PaymentPlanExtension
8
8
  'StartDate': start_date,
9
9
  'EndDate': end_date
10
10
  }
11
- options.merge!({:basic_auth => @auth})
11
+ options.merge!(basic_auth: @auth, headers: @headers)
12
12
  options.merge!(:body => parameters)
13
13
  response = self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Payments/Plan/Schedule"), options)
14
14
  JSON.parse(response.body)
@@ -19,14 +19,14 @@ module PaymentPlanExtension
19
19
  {
20
20
  'ValidatePaymentPlan': true
21
21
  }
22
- options.merge!({:basic_auth => @auth})
22
+ options.merge!(basic_auth: @auth, headers: @headers)
23
23
  options.merge!(:body => parameters)
24
24
  response = self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Validate"), options)
25
25
  JSON.parse(response.body)
26
26
  end
27
27
 
28
28
  def remove_payment_plan(session_key, options={})
29
- options.merge!({:basic_auth => @auth})
29
+ options.merge!(basic_auth: @auth, headers: @headers)
30
30
  self.class.delete(base_api_endpoint("Web/Cart/#{session_key}/Payments/Plan"), options)
31
31
  end
32
32
  end
@@ -1,7 +1,7 @@
1
1
  module Session
2
2
 
3
3
  def get_session(key, options={})
4
- options.merge!({:basic_auth => @auth})
4
+ options.merge!(basic_auth: @auth, headers: @headers)
5
5
  response = self.class.get(base_api_endpoint("Web/Session/#{key}"), options)
6
6
  JSON.parse(response.body)
7
7
  end
@@ -12,14 +12,14 @@ module Session
12
12
  'IpAddress': ip,
13
13
  'Organization': 'Tessitura Web'
14
14
  }
15
- options.merge!({:basic_auth => @auth})
15
+ options.merge!(basic_auth: @auth, headers: @headers)
16
16
  options.merge!(:body => parameters)
17
17
  response = self.class.post(base_api_endpoint('Web/Session'), options)
18
18
  JSON.parse(response.body)
19
19
  end
20
20
 
21
21
  def get_expiration(key, options={})
22
- options.merge!({:basic_auth => @auth})
22
+ options.merge!(basic_auth: @auth, headers: @headers)
23
23
  response = self.class.get(base_api_endpoint("Web/Session/#{key}/Expiration"), options)
24
24
  JSON.parse(response.body)
25
25
  end
@@ -29,14 +29,14 @@ module Session
29
29
  {
30
30
  'Expiration': expiration
31
31
  }
32
- options.merge!({:basic_auth => @auth})
32
+ options.merge!(basic_auth: @auth, headers: @headers)
33
33
  options.merge!(:body => parameters)
34
34
  response = self.class.put(base_api_endpoint("Web/Session/#{key}/Expiration"), options)
35
35
  JSON.parse(response.body)
36
36
  end
37
37
 
38
38
  def load_existing_order(key, order_id, options={})
39
- options.merge!({:basic_auth => @auth})
39
+ options.merge!(basic_auth: @auth, headers: @headers)
40
40
  self.class.post(base_api_endpoint("Web/Session/#{key}/LoadOrder/#{order_id}"), options)
41
41
  end
42
42
 
@@ -45,7 +45,7 @@ module Session
45
45
  {
46
46
  'PromoCode': code
47
47
  }
48
- options.merge!({:basic_auth => @auth})
48
+ options.merge!(basic_auth: @auth, headers: @headers)
49
49
  options.merge!(:body => parameters)
50
50
  response = self.class.post(base_api_endpoint("Web/Session/#{key}/PromoCode"), options)
51
51
  JSON.parse(response.body)
@@ -56,7 +56,7 @@ module Session
56
56
  {
57
57
  'PromoCodeString': code
58
58
  }
59
- options.merge!({:basic_auth => @auth})
59
+ options.merge!(basic_auth: @auth, headers: @headers)
60
60
  options.merge!(:body => parameters)
61
61
  response = self.class.post(base_api_endpoint("Web/Session/#{key}/PromoCode"), options)
62
62
  JSON.parse(response.body)
@@ -69,7 +69,7 @@ module Session
69
69
  'LoginTypeId': login_type,
70
70
  'EmailAddress': email
71
71
  }
72
- options.merge!({:basic_auth => @auth})
72
+ options.merge!(basic_auth: @auth, headers: @headers)
73
73
  options.merge!(:body => parameters)
74
74
  self.class.post(base_api_endpoint("/Web/Session/#{key}/Login/SendCredentials"), options)
75
75
  end
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: 0.3.15
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brittany Martin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-08 00:00:00.000000000 Z
11
+ date: 2019-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler