tessitura_rest 0.8 → 0.8.5

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: 13604ccbc3d66c08e47b8c0478f289d413bb54f65c5bd41e6b3ea8e96de234de
4
- data.tar.gz: 9320bdfe4d3516ce09297c82bbe81d2cd70bbee81492159feda889049f261a20
3
+ metadata.gz: 345f1da7aa6d63a1d827546acc3171483c777ba8ff4a0123d13116223aaf2645
4
+ data.tar.gz: 9b9dfd0901d4bf2034e94dff62a983af75621c856d199656294a2d37d400bd09
5
5
  SHA512:
6
- metadata.gz: d86d5b7239fbef5f40a4396243a6e7120a7125469947d3c49a8304f44f818bacc9c8296a96bed46104143c4654a677a4e9e48a4f700115e14af68755f7cd139b
7
- data.tar.gz: 7c7b45987db21ed4edf25b59ceaaa86a766e572ffb45a1d5bf68f9b12f27de0b078c57b0e255c570aa8ffb481583bb59d98d026f1bf53af71a1fb423162b1a60
6
+ metadata.gz: 51355fd503e62044b2b5acfec524394f15ae50e8cadce8de93064ad44b9cfa7797cf435fcb38bb5ba5093094eefb2461efa2292754278ca2743cdf8fa2e8410a
7
+ data.tar.gz: '027897de89660cf0edfeffd16c75c1611dc5df63004351fc2dec684a2ff383e11e2329f3aa1917c655dc2252101c8ac665bb7afd6f09ff3fb073c06a177a2639'
Binary file
@@ -2,4 +2,6 @@ sudo: false
2
2
  language: ruby
3
3
  rvm:
4
4
  - 2.4.2
5
- before_install: gem install bundler -v 1.12.5
5
+ before_install:
6
+ - gem install bundler -v 1.12.5
7
+ - openssl aes-256-cbc -K $encrypted_3c84dcdc6bbe_key -iv $encrypted_3c84dcdc6bbe_iv -in .env.enc -out .env -d
data/Gemfile CHANGED
@@ -2,9 +2,11 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- group :test do
6
- gem 'webmock'
7
- gem 'vcr'
8
- gem 'simplecov'
5
+ group :test, :development do
6
+ gem 'activesupport'
9
7
  gem 'dotenv'
8
+ gem 'pry-byebug'
9
+ gem 'simplecov'
10
+ gem 'vcr'
11
+ gem 'webmock'
10
12
  end
@@ -12,6 +12,60 @@ module Constituencies
12
12
  JSON.parse(response.body)
13
13
  end
14
14
 
15
+ def create_constituent_by_snapshot(first_name, last_name, email, phone, constituent_type, source, street1, street2, city, state, zip, country, options={})
16
+ parameters =
17
+ {
18
+ "ConstituentType": {
19
+ "Id": constituent_type,
20
+ "Inactive": false,
21
+ },
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
+ "PrimaryPhoneNumbers":
36
+ [
37
+ {
38
+ "PhoneNumber": phone,
39
+ "PhoneType":
40
+ {
41
+ "Id": 1
42
+ },
43
+ },
44
+ ],
45
+ "OriginalSource": {
46
+ "Id": source,
47
+ },
48
+ "Address": {
49
+ "AddressType": {
50
+ "Id": 3,
51
+ },
52
+ "City": city,
53
+ "PostalCode": zip,
54
+ "State": {
55
+ "Id": state,
56
+ },
57
+ "Street1": street1,
58
+ "Street2": street2,
59
+ "Country": {
60
+ "Id": country,
61
+ },
62
+ }
63
+ }
64
+ options.merge!(basic_auth: @auth, headers: @headers)
65
+ options.merge!(:body => parameters.to_json, :headers => { 'Content-Type' => 'application/json' })
66
+ self.class.post(base_api_endpoint('CRM/Constituents/Snapshot'), options)
67
+ end
68
+
15
69
  def create_constituencies(constituency, id, options={})
16
70
  parameters =
17
71
  {
@@ -26,4 +80,4 @@ module Constituencies
26
80
  options.merge!(:body => parameters)
27
81
  response = self.class.post(base_api_endpoint('CRM/Constituencies'), options)
28
82
  end
29
- end
83
+ 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.8'
2
+ VERSION = '0.8.5'
3
3
  end
@@ -7,8 +7,8 @@ module Registration
7
7
  'LastName': last_name,
8
8
  'ElectronicAddress': {
9
9
  'Address': email,
10
+ 'AllowMarketing': special_offer || 0,
10
11
  },
11
- 'EmarketIndicatorId': special_offer,
12
12
  'WebLogin': {
13
13
  'Login': email,
14
14
  'LoginTypeId': 1,
@@ -25,15 +25,16 @@ module Registration
25
25
  },
26
26
  'ConstituentTypeId': 1,
27
27
  'OriginalSourceId': 3,
28
- 'Phones': [
29
- {
30
- 'PhoneNumber': phone,
31
- 'PhoneTypeId': 1
32
- },
33
- ],
34
- }
28
+ 'Phones':
29
+ [
30
+ {
31
+ 'PhoneNumber': phone,
32
+ 'PhoneTypeId': 1
33
+ },
34
+ ],
35
+ }
35
36
  options.merge!(basic_auth: @auth, headers: @headers)
36
- options.merge!(body: parameters)
37
+ options.merge!(:body => parameters.to_json, :headers => {'Content-Type' => 'application/json'})
37
38
  self.class.post(base_api_endpoint("Web/Registration/#{session_key}/Register"), options)
38
39
  end
39
40
 
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.8'
4
+ version: 0.8.5
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-12-02 00:00:00.000000000 Z
11
+ date: 2021-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -117,6 +117,7 @@ extensions: []
117
117
  extra_rdoc_files: []
118
118
  files:
119
119
  - ".codeclimate.yml"
120
+ - ".env.enc"
120
121
  - ".gitignore"
121
122
  - ".rspec"
122
123
  - ".rubocop.yml"