tessitura_rest 0.7.9 → 0.8.4

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: 3ceea7ad3329bc14ce2cb3227f84a6169102a15b475deb8a909b81d47bb1de7d
4
- data.tar.gz: 1f8e1059a28a178259cc459817d1c90ccd99f90fd694223f0a011efc1e8163ec
3
+ metadata.gz: 668d34582e4f9aede726c153b832d6aa0aa9a7a093e5d101aa00c9ae34d6fe6a
4
+ data.tar.gz: 0f206652cf18fd669c6c7851fb8b885934a42bed8a3a340d86e12b69bc6273ea
5
5
  SHA512:
6
- metadata.gz: 77a696486fa373479de3d2ae1916d2bee9c9001c86d8dc5b72fc4115e4265996e74b8a21da05b15a4636b56f5f9d9cd50cc31e7affb25685d34fc0d23edb3b00
7
- data.tar.gz: a31ec251bf695c1bb2d7a60ef5176f5d16a379953c15ea94364b237aa63d739289a9560a35cc4c6fe56ad977863335be11f2b7238333e8e5ef2a8131c856986e
6
+ metadata.gz: 6f0cca944536b92dae90db2cfac9b948120f3eda4ad9306d24d96f110fa4ec4df764f12885eccf81b2892c0996d9916ccf32a751270918a9af2e68862c7dd4c6
7
+ data.tar.gz: 06f593d18956d2e9dcb9290790c3e5ebc57735cb26dfe52de12f996ff25f440beee14e97182a619b7def2f3df65a018379477aa32645d8f023c73441eb6eb7cf
@@ -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,50 @@ 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, source, street1, street2, city, state, zip, 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": source,
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
+ "Street2": street2,
49
+ "Country": {
50
+ "Id": country,
51
+ },
52
+ }
53
+ }
54
+ options.merge!(basic_auth: @auth, headers: @headers)
55
+ options.merge!(:body => parameters)
56
+ response = self.class.post(base_api_endpoint('CRM/Constituents/Snapshot'), options)
57
+ end
58
+
15
59
  def create_constituencies(constituency, id, options={})
16
60
  parameters =
17
61
  {
@@ -26,4 +70,4 @@ module Constituencies
26
70
  options.merge!(:body => parameters)
27
71
  response = self.class.post(base_api_endpoint('CRM/Constituencies'), options)
28
72
  end
29
- end
73
+ 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
@@ -1,3 +1,3 @@
1
1
  class TessituraRest
2
- VERSION = '0.7.9'
2
+ VERSION = '0.8.4'
3
3
  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.9
4
+ version: 0.8.4
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-11-11 00:00:00.000000000 Z
11
+ date: 2020-12-29 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