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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 668d34582e4f9aede726c153b832d6aa0aa9a7a093e5d101aa00c9ae34d6fe6a
|
4
|
+
data.tar.gz: 0f206652cf18fd669c6c7851fb8b885934a42bed8a3a340d86e12b69bc6273ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f0cca944536b92dae90db2cfac9b948120f3eda4ad9306d24d96f110fa4ec4df764f12885eccf81b2892c0996d9916ccf32a751270918a9af2e68862c7dd4c6
|
7
|
+
data.tar.gz: 06f593d18956d2e9dcb9290790c3e5ebc57735cb26dfe52de12f996ff25f440beee14e97182a619b7def2f3df65a018379477aa32645d8f023c73441eb6eb7cf
|
data/lib/tessitura_rest.rb
CHANGED
@@ -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
|
@@ -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.
|
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
|
+
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
|