tessitura_rest 0.7.7 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c92b4ac1cb6689828a47145dfade0414efc73d5d24268b77c75104ab3c47311b
4
- data.tar.gz: f44b884c3956e7d92f076b1c47ebf0cea260ba8dd6839e6f2df0a97a6f821cc8
3
+ metadata.gz: 5e9e251334a6a2a5ff55a138575ba4b8d344b7372cc063c6bb7d3502edbca902
4
+ data.tar.gz: efeaa20c189d02d0e699420e7c15fd095ac24536c4dff4dcfc00eadf21577887
5
5
  SHA512:
6
- metadata.gz: cb4975f83d2fe5082d588b925c2b0f1e947e00a8f3aee36242d82ca74428276f84b0b8ea0313c279e501b3f441c414aaf468f4a0c45a8d8a9b431a818fd853bc
7
- data.tar.gz: cc943048aca8ee25287d67517736738da37f53ad4766e834cca4624b5d63c7300c382a72e32c6be9dbd56a14805da180c2fa716a6d8bfc46f8a207e2cb958454
6
+ metadata.gz: 60aa12cf535e632ae67ef8742c8adb4ef4e2749ae6ddbca4afb20256ae932e65e4cbb6eeb904bd5c14d0a30b270c771f29ef8be8261fc89f235cfd43b3cad403
7
+ data.tar.gz: 85e76c4e58ff6a32c034722057acb17d9193668b224f5abd01d41f32d46cd5c0dfbe4aa56fbbf57997ecef04090eb3f16cc67155acbb99b56336dd1a67529136
@@ -31,6 +31,7 @@ class TessituraRest
31
31
  include ProductionExtension
32
32
  include ProductKeywords
33
33
  include ProductionSeason
34
+ include Registration
34
35
  include Sections
35
36
  include Session
36
37
  include SecurityUserGroups
@@ -12,6 +12,49 @@ module Constituencies
12
12
  JSON.parse(response.body)
13
13
  end
14
14
 
15
+ def create_constituent_by_snapshot(first_name, last_name, email, constituent_type, city, zip, state, street1, country, options={})
16
+ parameters = {
17
+ "ConstituentType": {
18
+ "Id": constituent_type,
19
+ "Inactive": false,
20
+ },
21
+ "DisplayName": "#{first_name} #{last_name}",
22
+ "FirstName": first_name,
23
+ "LastName": last_name,
24
+ "ElectronicAddress": {
25
+ "Address": email,
26
+ "ElectronicAddressType": {
27
+ "Id": 1,
28
+ },
29
+ "AllowHtmlFormat": true,
30
+ "Inactive": false,
31
+ "AllowMarketing": false,
32
+ "Months": 'YYYYYYYYYYYY',
33
+ "PrimaryIndicator": true,
34
+ },
35
+ "OriginalSource": {
36
+ "Id": 3,
37
+ },
38
+ "Address": {
39
+ "AddressType": {
40
+ "Id": 3,
41
+ },
42
+ "City": city,
43
+ "PostalCode": zip,
44
+ "State": {
45
+ "Id": state,
46
+ },
47
+ "Street1": street1,
48
+ "Country": {
49
+ "Id": country,
50
+ },
51
+ }
52
+ }
53
+ options.merge!(basic_auth: @auth, headers: @headers)
54
+ options.merge!(:body => parameters)
55
+ response = self.class.post(base_api_endpoint('CRM/Constituents/Snapshot'), options)
56
+ end
57
+
15
58
  def create_constituencies(constituency, id, options={})
16
59
  parameters =
17
60
  {
@@ -26,4 +69,4 @@ module Constituencies
26
69
  options.merge!(:body => parameters)
27
70
  response = self.class.post(base_api_endpoint('CRM/Constituencies'), options)
28
71
  end
29
- end
72
+ end
@@ -5,4 +5,27 @@ module WebLogins
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
8
+
9
+ def create_web_login(constituent, email_id, email, login_type, primary, temporary, options={})
10
+ parameters = {
11
+ 'Constituent': {
12
+ 'Id': constituent,
13
+ },
14
+ 'Email': {
15
+ 'Id': email_id,
16
+ },
17
+ 'FailedAttempts': 3,
18
+ 'Inactive': false,
19
+ 'Login': email,
20
+ 'LoginType': {
21
+ 'Id': login_type,
22
+ },
23
+ 'PrimaryIndicator': primary,
24
+ 'TemporaryIndicator': temporary,
25
+ }
26
+ options.merge!(basic_auth: @auth, headers: @headers)
27
+ options.merge!(:body => parameters)
28
+ self.class.post(base_api_endpoint('CRM/WebLogins'), options)
29
+ end
30
+
8
31
  end
@@ -3,7 +3,8 @@ module PerformanceExtension
3
3
  def get_performances_by_production(ids, mode_of_sale=nil, options={})
4
4
  parameters =
5
5
  {
6
- 'ProductionSeasonIds': ids,
6
+ 'ProductionSeasonIds': ids,
7
+ 'BusinessUnitId': 1,
7
8
  'ModeOfSaleId': mode_of_sale
8
9
  }
9
10
  options.merge!(basic_auth: @auth, headers: @headers)
@@ -1,3 +1,3 @@
1
1
  class TessituraRest
2
- VERSION = '0.7.7'
2
+ VERSION = '0.8.2'
3
3
  end
@@ -290,4 +290,24 @@ module Cart
290
290
  put = self.class.put(base_api_endpoint("Web/Cart/#{session_key}/CustomData/#{index}"), options)
291
291
  put.success?
292
292
  end
293
- end
293
+
294
+ def checkout(session_key, name_on_card, credit_card_number, cvv_number, credit_card_type, expiration_month, expiration_year, is_order_authorized, order_authorization_code, order_amount, allow_under_payment, options={})
295
+ parameters =
296
+ {
297
+ "CreditCardOwner": name_on_card,
298
+ "CreditCardNumber": credit_card_number,
299
+ "CreditCardType": credit_card_type,
300
+ "CreditCardMonth": expiration_month,
301
+ "CreditCardYear": expiration_year,
302
+ "Amount": order_amount,
303
+ "AllowUnderPayment": allow_under_payment,
304
+ "CreditCardAuthenticationCode": cvv_number,
305
+ "Authorize": is_order_authorized,
306
+ "AuthorizationCode": order_authorization_code,
307
+ }
308
+ options.merge!(basic_auth: @auth, headers: @headers)
309
+ options.merge!(:body => parameters)
310
+ self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Checkout"), options)
311
+ end
312
+
313
+ end
@@ -0,0 +1,41 @@
1
+ module Registration
2
+
3
+ def register_user(session_key, address, first_name, last_name, email, password, special_offer, phone, options={})
4
+ 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
+ 'Phones':
29
+ [
30
+ {
31
+ 'PhoneNumber': phone,
32
+ 'PhoneTypeId': 1
33
+ },
34
+ ],
35
+ }
36
+ options.merge!(basic_auth: @auth, headers: @headers)
37
+ options.merge!(:body => parameters.to_json, :headers => {'Content-Type' => 'application/json'})
38
+ self.class.post(base_api_endpoint("Web/Registration/#{session_key}/Register"), options)
39
+ end
40
+
41
+ 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.7.7
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brittany Martin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-18 00:00:00.000000000 Z
11
+ date: 2020-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -161,6 +161,7 @@ files:
161
161
  - lib/tessitura_rest/web/cart.rb
162
162
  - lib/tessitura_rest/web/login.rb
163
163
  - lib/tessitura_rest/web/payment_plan_extension.rb
164
+ - lib/tessitura_rest/web/registration.rb
164
165
  - lib/tessitura_rest/web/session.rb
165
166
  - tessitura_rest.gemspec
166
167
  homepage: https://github.com/pgharts/tessitura