tessitura_rest 1.1.6 → 1.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +37 -0
  3. data/.codeclimate.yml +10 -3
  4. data/.github/workflows/gem-push.yml +34 -0
  5. data/.rubocop.yml +23 -7
  6. data/lib/tessitura_rest/crm/accounts.rb +4 -3
  7. data/lib/tessitura_rest/crm/addresses.rb +79 -80
  8. data/lib/tessitura_rest/crm/attributes.rb +9 -10
  9. data/lib/tessitura_rest/crm/constituencies.rb +8 -9
  10. data/lib/tessitura_rest/crm/constituents.rb +72 -75
  11. data/lib/tessitura_rest/crm/issues.rb +19 -33
  12. data/lib/tessitura_rest/crm/phones.rb +12 -13
  13. data/lib/tessitura_rest/crm/web_logins.rb +2 -4
  14. data/lib/tessitura_rest/custom/email.rb +15 -15
  15. data/lib/tessitura_rest/custom/local_procedure.rb +2 -2
  16. data/lib/tessitura_rest/diagnostics/diagnostics.rb +2 -2
  17. data/lib/tessitura_rest/finance/appeals.rb +1 -2
  18. data/lib/tessitura_rest/finance/gift_certificates.rb +1 -2
  19. data/lib/tessitura_rest/reference_data/countries.rb +2 -3
  20. data/lib/tessitura_rest/reference_data/sections.rb +1 -2
  21. data/lib/tessitura_rest/reference_data/states.rb +2 -3
  22. data/lib/tessitura_rest/security/security_user_groups.rb +2 -3
  23. data/lib/tessitura_rest/txn/orders.rb +1 -17
  24. data/lib/tessitura_rest/txn/package.rb +11 -11
  25. data/lib/tessitura_rest/txn/payments.rb +1 -1
  26. data/lib/tessitura_rest/txn/performance_extension.rb +15 -14
  27. data/lib/tessitura_rest/txn/performance_package_mode_of_sales.rb +2 -4
  28. data/lib/tessitura_rest/txn/price_types.rb +2 -4
  29. data/lib/tessitura_rest/txn/product_keywords.rb +1 -3
  30. data/lib/tessitura_rest/txn/production_extension.rb +2 -3
  31. data/lib/tessitura_rest/txn/production_season.rb +3 -5
  32. data/lib/tessitura_rest/txn/sub_line_items.rb +4 -4
  33. data/lib/tessitura_rest/txn/web_contents.rb +1 -3
  34. data/lib/tessitura_rest/version.rb +1 -1
  35. data/lib/tessitura_rest/web/cart.rb +141 -143
  36. data/lib/tessitura_rest/web/login.rb +26 -13
  37. data/lib/tessitura_rest/web/payment_plan_extension.rb +18 -19
  38. data/lib/tessitura_rest/web/registration.rb +34 -36
  39. data/lib/tessitura_rest/web/session.rb +37 -38
  40. data/lib/tessitura_rest.rb +1 -3
  41. data/tessitura_rest.gemspec +17 -15
  42. metadata +24 -25
  43. data/.env.enc +0 -0
  44. data/.travis.yml +0 -7
  45. data/lib/tessitura_rest/crm/actions.rb +0 -36
@@ -1,42 +1,40 @@
1
1
  module Registration
2
-
3
- def register_user(session_key, address, first_name, last_name, email, password, promotion, special_offer, phone, options={})
2
+ def register_user(session_key, address, first_name, last_name, email, password, promotion, special_offer, phone, options = {})
4
3
  parameters =
5
- {
6
- 'FirstName': first_name,
7
- 'LastName': last_name,
8
- 'ElectronicAddress': {
9
- 'Address': email,
10
- 'AllowMarketing': special_offer || 0,
11
- },
12
- 'WebLogin': {
13
- 'Login': email,
14
- 'LoginTypeId': 1,
15
- 'Password': password
16
- },
17
- 'Address': {
18
- 'AddressTypeId': 3,
19
- 'City': address.city,
20
- 'PostalCode': address.postal_code,
21
- 'StateId': address.state,
22
- 'Street1': address.street1,
23
- 'Street2': address.street2,
24
- 'CountryId': address.country
25
- },
26
- 'ConstituentTypeId': 1,
27
- 'OriginalSourceId': 3,
28
- 'SourceId': promotion,
29
- 'Phones':
30
- [
31
- {
32
- 'PhoneNumber': phone,
33
- 'PhoneTypeId': 1
34
- },
35
- ],
36
- }
4
+ {
5
+ 'FirstName': first_name,
6
+ 'LastName': last_name,
7
+ 'ElectronicAddress': {
8
+ 'Address': email,
9
+ 'AllowMarketing': special_offer || 0,
10
+ },
11
+ 'WebLogin': {
12
+ 'Login': email,
13
+ 'LoginTypeId': 1,
14
+ 'Password': password,
15
+ },
16
+ 'Address': {
17
+ 'AddressTypeId': 3,
18
+ 'City': address.city,
19
+ 'PostalCode': address.postal_code,
20
+ 'StateId': address.state,
21
+ 'Street1': address.street1,
22
+ 'Street2': address.street2,
23
+ 'CountryId': address.country,
24
+ },
25
+ 'ConstituentTypeId': 1,
26
+ 'OriginalSourceId': 3,
27
+ 'SourceId': promotion,
28
+ 'Phones':
29
+ [
30
+ {
31
+ 'PhoneNumber': phone,
32
+ 'PhoneTypeId': 1,
33
+ },
34
+ ],
35
+ }
37
36
  options.merge!(basic_auth: @auth, headers: @headers)
38
- options.merge!(:body => parameters.to_json, :headers => {'Content-Type' => 'application/json'})
37
+ options.merge!(:body => parameters.to_json, :headers => { 'Content-Type' => 'application/json' })
39
38
  self.class.post(base_api_endpoint("Web/Registration/#{session_key}/Register"), options)
40
39
  end
41
-
42
40
  end
@@ -1,30 +1,29 @@
1
1
  module Session
2
-
3
- def get_session(key, options={})
2
+ def get_session(key, options = {})
4
3
  options.merge!(basic_auth: @auth, headers: @headers)
5
4
  response = self.class.get(base_api_endpoint("Web/Session/#{key}"), options)
6
5
  JSON.parse(response.body)
7
6
  end
8
7
 
9
- def create_session(ip, options={})
8
+ def create_session(ip, options = {})
10
9
  parameters =
11
- {
12
- 'IpAddress': ip,
13
- 'Organization': 'Tessitura Web'
14
- }
10
+ {
11
+ 'IpAddress': ip,
12
+ 'Organization': 'Tessitura Web',
13
+ }
15
14
  options.merge!(basic_auth: @auth, headers: @headers)
16
15
  options.merge!(body: parameters)
17
16
  response = self.class.post(base_api_endpoint('Web/Session'), options)
18
17
  JSON.parse(response.body)
19
18
  end
20
19
 
21
- def get_expiration(key, options={})
20
+ def get_expiration(key, options = {})
22
21
  options.merge!(basic_auth: @auth, headers: @headers)
23
22
  response = self.class.get(base_api_endpoint("Web/Session/#{key}/Expiration"), options)
24
23
  JSON.parse(response.body)
25
24
  end
26
25
 
27
- def transfer_session(session_key, new_session_key, options={})
26
+ def transfer_session(session_key, new_session_key, options = {})
28
27
  parameters =
29
28
  {
30
29
  'NewSessionKey': new_session_key,
@@ -34,34 +33,34 @@ module Session
34
33
  self.class.post(base_api_endpoint("Web/Session/#{session_key}/Transfer"), options)
35
34
  end
36
35
 
37
- def get_variables(key, options={})
36
+ def get_variables(key, options = {})
38
37
  options.merge!(basic_auth: @auth, headers: @headers)
39
38
  response = self.class.get(base_api_endpoint("Web/Session/#{key}/Variables"), options)
40
39
  JSON.parse(response.body)
41
40
  end
42
41
 
43
- def set_expiration(key, timeoffset, expiration, options={})
42
+ def set_expiration(key, timeoffset, expiration, options = {})
44
43
  parameters =
45
- {
46
- 'Expiration': expiration,
47
- 'TimeOffset': timeoffset
48
- }
44
+ {
45
+ 'Expiration': expiration,
46
+ 'TimeOffset': timeoffset,
47
+ }
49
48
  options.merge!(basic_auth: @auth, headers: @headers)
50
49
  options.merge!(:body => parameters)
51
50
  response = self.class.put(base_api_endpoint("Web/Session/#{key}/Expiration"), options)
52
51
  JSON.parse(response.body)
53
52
  end
54
53
 
55
- def load_existing_order(key, order_id, options={})
54
+ def load_existing_order(key, order_id, options = {})
56
55
  options.merge!(basic_auth: @auth, headers: @headers)
57
56
  self.class.post(base_api_endpoint("Web/Session/#{key}/LoadOrder/#{order_id}"), options)
58
57
  end
59
58
 
60
- def get_promotion(key, code, code_string, options={})
59
+ def get_promotion(key, code, code_string, options = {})
61
60
  parameters =
62
61
  {
63
62
  'PromoCode': code,
64
- 'PromoCodeString': code_string
63
+ 'PromoCodeString': code_string,
65
64
  }
66
65
  options.merge!(basic_auth: @auth, headers: @headers)
67
66
  options.merge!(:body => parameters)
@@ -69,42 +68,42 @@ module Session
69
68
  JSON.parse(response.body)
70
69
  end
71
70
 
72
- def get_renewals(key, season_id, renewal, mode_of_sale, options={})
71
+ def get_renewals(key, season_id, renewal, mode_of_sale, options = {})
73
72
  options.merge!(basic_auth: @auth, headers: @headers)
74
73
  response = self.class.get(base_api_endpoint("Web/Session/#{key}/Orders/Search?seasonId=#{season_id}&renewalsOnly=#{renewal}&modeOfSaleId=#{mode_of_sale}"), options)
75
74
  JSON.parse(response.body)
76
75
  end
77
76
 
78
- def send_credentials(key, email, login_type, template_id, options={})
77
+ def send_credentials(key, email, login_type, template_id, options = {})
79
78
  parameters =
80
- {
81
- 'TemplateFormatId': template_id,
82
- 'LoginTypeId': login_type,
83
- 'EmailAddress': email
84
- }
79
+ {
80
+ 'TemplateFormatId': template_id,
81
+ 'LoginTypeId': login_type,
82
+ 'EmailAddress': email,
83
+ }
85
84
  options.merge!(basic_auth: @auth, headers: @headers)
86
85
  options.merge!(:body => parameters)
87
86
  self.class.post(base_api_endpoint("/Web/Session/#{key}/Login/SendCredentials"), options)
88
87
  end
89
88
 
90
- def update_login(key, user_name, old_password, new_password, email, new_email, options={})
89
+ def update_login(key, user_name, old_password, new_password, email, new_email, options = {})
91
90
  parameters =
92
- {
93
- 'LoginName': user_name,
94
- 'NewLoginName': new_email,
95
- 'Password': old_password,
96
- 'NewPassword': new_password,
97
- 'EmailAddress': email,
98
- 'NewEmailAddress': new_email,
99
- 'LoginTypeId': 1,
100
- 'PromotionCode': 0,
101
- }
91
+ {
92
+ 'LoginName': user_name,
93
+ 'NewLoginName': new_email,
94
+ 'Password': old_password,
95
+ 'NewPassword': new_password,
96
+ 'EmailAddress': email,
97
+ 'NewEmailAddress': new_email,
98
+ 'LoginTypeId': 1,
99
+ 'PromotionCode': 0,
100
+ }
102
101
  options.merge!(basic_auth: @auth, headers: @headers)
103
- options.merge!(:body => parameters.to_json, :headers => {'Content-Type' => 'application/json'})
102
+ options.merge!(:body => parameters.to_json, :headers => { 'Content-Type' => 'application/json' })
104
103
  self.class.put(base_api_endpoint("Web/Session/#{key}/WebLogins"), options)
105
104
  end
106
105
 
107
- def get_shipping_methods(key, options={})
106
+ def get_shipping_methods(key, options = {})
108
107
  options.merge!(basic_auth: @auth, headers: @headers)
109
108
  response = self.class.get(base_api_endpoint("Web/Session/#{key}/DeliveryMethods"), options)
110
109
  JSON.parse(response.body)
@@ -7,7 +7,6 @@ class TessituraRest
7
7
  include HTTParty
8
8
 
9
9
  include Accounts
10
- include Actions
11
10
  include Addresses
12
11
  include Attributes
13
12
  include Appeals
@@ -42,7 +41,7 @@ class TessituraRest
42
41
  include WebContents
43
42
  include WebLogins
44
43
 
45
- def initialize(options={})
44
+ def initialize(options = {})
46
45
  @auth = { username: ENV['TESSITURA_USERNAME'],
47
46
  password: ENV['TESSITURA_PASSWORD'] }
48
47
  @headers = { 'Accept': 'application/json' }
@@ -51,5 +50,4 @@ class TessituraRest
51
50
  def base_api_endpoint(end_point)
52
51
  "#{ENV['TESSITURA_URL']}#{end_point}"
53
52
  end
54
-
55
53
  end
@@ -1,29 +1,31 @@
1
1
  # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
2
+
3
+ lib = File.expand_path('lib', __dir__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'tessitura_rest/version'
5
6
 
6
7
  Gem::Specification.new do |spec|
7
- spec.name = "tessitura_rest"
8
+ spec.required_ruby_version = '>= 2.6.0'
9
+ spec.name = 'tessitura_rest'
8
10
  spec.version = TessituraRest::VERSION
9
11
  spec.authors = ['Brittany Martin, Danielle Greaves, Craig Donavin, Patrick FitzGerald']
10
12
  spec.email = ['webteam@trustarts.org']
11
13
 
12
- spec.summary = "Rest API Endpoint for the Tessitura Rest API (v14+)."
13
- spec.description = "TessituraRest is an enterprise-wide, fully integrated software system for arts & cultural organizations."
14
- spec.homepage = "https://github.com/pgharts/tessitura"
15
- spec.license = "MIT"
14
+ spec.summary = 'Rest API Endpoint for the Tessitura Rest API (v14+).'
15
+ spec.description = 'TessituraRest is an enterprise-wide, fully integrated software system for arts & cultural organizations.'
16
+ spec.homepage = 'https://github.com/pgharts/tessitura'
17
+ spec.license = 'MIT'
16
18
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
- spec.bindir = "exe"
19
+ spec.bindir = 'exe'
18
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
- spec.require_paths = ["lib"]
21
+ spec.require_paths = ['lib']
20
22
 
21
- spec.add_development_dependency "bundler", "~> 2.0"
22
- spec.add_development_dependency "rake", "~> 13.0"
23
- spec.add_development_dependency "rspec", "~> 3.0"
24
- spec.add_development_dependency "pry"
23
+ spec.add_development_dependency 'bundler', '~> 2.0'
24
+ spec.add_development_dependency 'pry'
25
+ spec.add_development_dependency 'rake', '~> 13.0'
26
+ spec.add_development_dependency 'rspec', '~> 3.0'
25
27
 
26
- spec.add_dependency "json"
27
- spec.add_dependency "httparty"
28
- spec.add_dependency "require_all"
28
+ spec.add_dependency 'httparty'
29
+ spec.add_dependency 'json'
30
+ spec.add_dependency 'require_all'
29
31
  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: 1.1.6
4
+ version: 1.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brittany Martin, Danielle Greaves, Craig Donavin, Patrick FitzGerald
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-22 00:00:00.000000000 Z
11
+ date: 2022-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -25,49 +25,49 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: pry
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '13.0'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '13.0'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rspec
42
+ name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.0'
47
+ version: '13.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '3.0'
54
+ version: '13.0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: pry
56
+ name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '3.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '3.0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: json
70
+ name: httparty
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -81,7 +81,7 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: httparty
84
+ name: json
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
@@ -116,13 +116,13 @@ executables: []
116
116
  extensions: []
117
117
  extra_rdoc_files: []
118
118
  files:
119
+ - ".circleci/config.yml"
119
120
  - ".codeclimate.yml"
120
- - ".env.enc"
121
121
  - ".github/dependabot.yml"
122
+ - ".github/workflows/gem-push.yml"
122
123
  - ".gitignore"
123
124
  - ".rspec"
124
125
  - ".rubocop.yml"
125
- - ".travis.yml"
126
126
  - CODE_OF_CONDUCT.md
127
127
  - Gemfile
128
128
  - LICENSE.txt
@@ -132,7 +132,6 @@ files:
132
132
  - bin/setup
133
133
  - lib/tessitura_rest.rb
134
134
  - lib/tessitura_rest/crm/accounts.rb
135
- - lib/tessitura_rest/crm/actions.rb
136
135
  - lib/tessitura_rest/crm/addresses.rb
137
136
  - lib/tessitura_rest/crm/attributes.rb
138
137
  - lib/tessitura_rest/crm/constituencies.rb
@@ -172,7 +171,7 @@ homepage: https://github.com/pgharts/tessitura
172
171
  licenses:
173
172
  - MIT
174
173
  metadata: {}
175
- post_install_message:
174
+ post_install_message:
176
175
  rdoc_options: []
177
176
  require_paths:
178
177
  - lib
@@ -180,15 +179,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
180
179
  requirements:
181
180
  - - ">="
182
181
  - !ruby/object:Gem::Version
183
- version: '0'
182
+ version: 2.6.0
184
183
  required_rubygems_version: !ruby/object:Gem::Requirement
185
184
  requirements:
186
185
  - - ">="
187
186
  - !ruby/object:Gem::Version
188
187
  version: '0'
189
188
  requirements: []
190
- rubygems_version: 3.2.15
191
- signing_key:
189
+ rubygems_version: 3.0.3.1
190
+ signing_key:
192
191
  specification_version: 4
193
192
  summary: Rest API Endpoint for the Tessitura Rest API (v14+).
194
193
  test_files: []
data/.env.enc DELETED
Binary file
data/.travis.yml DELETED
@@ -1,7 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.5.3
5
- before_install:
6
- - gem install bundler -v 2.2.15
7
- - openssl aes-256-cbc -K $encrypted_3c84dcdc6bbe_key -iv $encrypted_3c84dcdc6bbe_iv -in .env.enc -out .env -d
@@ -1,36 +0,0 @@
1
- module Actions
2
-
3
- def get_action(id, options={})
4
- options.merge!(basic_auth: @auth, headers: @headers)
5
- response = self.class.get(base_api_endpoint("CRM/Actions/#{id}"), options)
6
- JSON.parse(response.body)
7
- end
8
-
9
- def get_actions(constituent_id, issue_id, options={})
10
- options.merge!(basic_auth: @auth, headers: @headers)
11
- response = self.class.get(base_api_endpoint("CRM/Actions?constituentId=#{constituent_id}&issueId=#{issue_id}"), options)
12
- JSON.parse(response.body)
13
- end
14
-
15
- def create_action(action_type, constituent_id, issue_id, notes = '', options={})
16
- parameters =
17
- {
18
- 'ActionType': {
19
- 'Id': action_type
20
- },
21
- 'Issue': {
22
- 'Id': issue_id
23
- },
24
- 'Constituent': {
25
- 'Id': constituent_id
26
- },
27
- 'Notes': notes,
28
- 'Resolved': true,
29
- }
30
- options.merge!(basic_auth: @auth, headers: @headers)
31
- options.merge!(:body => parameters)
32
- response = self.class.post(base_api_endpoint('CRM/Actions'), options)
33
- JSON.parse(response.body)
34
- end
35
-
36
- end