infusionsoft 1.1.8 → 1.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +6 -0
  3. data/.travis.yml +9 -0
  4. data/Gemfile +12 -0
  5. data/LICENSE.md +0 -2
  6. data/README.md +17 -21
  7. data/Rakefile +12 -2
  8. data/infusionsoft.gemspec +2 -2
  9. data/lib/infusionsoft/client.rb +2 -0
  10. data/lib/infusionsoft/client/contact.rb +15 -5
  11. data/lib/infusionsoft/client/email.rb +1 -1
  12. data/lib/infusionsoft/client/funnel.rb +18 -0
  13. data/lib/infusionsoft/client/invoice.rb +1 -1
  14. data/lib/infusionsoft/connection.rb +1 -1
  15. data/lib/infusionsoft/request.rb +1 -0
  16. data/lib/infusionsoft/version.rb +1 -1
  17. data/test/client/contact_test.rb +79 -0
  18. data/test/client/data_test.rb +102 -0
  19. data/test/client/email_test.rb +89 -0
  20. data/test/exceptions_test.rb +131 -0
  21. data/test/test_helper.rb +47 -0
  22. data/test/vcr_cassettes/add_to_group.yml +49 -0
  23. data/test/vcr_cassettes/contact_add.yml +93 -0
  24. data/test/vcr_cassettes/contact_add_dup_check_no_dup.yml +93 -0
  25. data/test/vcr_cassettes/contact_add_dup_check_with_dup.yml +186 -0
  26. data/test/vcr_cassettes/contact_load.yml +49 -0
  27. data/test/vcr_cassettes/contact_merge.yml +49 -0
  28. data/test/vcr_cassettes/contact_update.yml +95 -0
  29. data/test/vcr_cassettes/data_add.yml +49 -0
  30. data/test/vcr_cassettes/data_add_custom_field.yml +49 -0
  31. data/test/vcr_cassettes/data_auth_user_failure.yml +50 -0
  32. data/test/vcr_cassettes/data_auth_user_success.yml +49 -0
  33. data/test/vcr_cassettes/data_delete.yml +49 -0
  34. data/test/vcr_cassettes/data_find_by_field.yml +51 -0
  35. data/test/vcr_cassettes/data_get_app_setting.yml +50 -0
  36. data/test/vcr_cassettes/data_load.yml +51 -0
  37. data/test/vcr_cassettes/data_query.yml +51 -0
  38. data/test/vcr_cassettes/data_query_order_by.yml +51 -0
  39. data/test/vcr_cassettes/data_update.yml +96 -0
  40. data/test/vcr_cassettes/data_update_custom_field.yml +49 -0
  41. data/test/vcr_cassettes/email_add.yml +50 -0
  42. data/test/vcr_cassettes/email_attach.yml +50 -0
  43. data/test/vcr_cassettes/email_get_available_merge_fields.yml +52 -0
  44. data/test/vcr_cassettes/email_get_opt_status.yml +50 -0
  45. data/test/vcr_cassettes/email_get_template.yml +118 -0
  46. data/test/vcr_cassettes/email_optin.yml +50 -0
  47. data/test/vcr_cassettes/email_optout.yml +50 -0
  48. data/test/vcr_cassettes/email_send.yml +50 -0
  49. data/test/vcr_cassettes/email_send_template.yml +50 -0
  50. data/test/vcr_cassettes/email_update_template.yml +50 -0
  51. data/test/vcr_cassettes/find_by_email.yml +49 -0
  52. data/test/vcr_cassettes/remove_from_group.yml +49 -0
  53. metadata +50 -17
  54. data/test/api_infusion_test.rb +0 -8
  55. data/test/test_exceptions.rb +0 -113
@@ -0,0 +1,186 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://test.infusionsoft.com/api/xmlrpc
6
+ body:
7
+ encoding: UTF-8
8
+ string: |
9
+ <?xml version="1.0" ?><methodCall><methodName>ContactService.load</methodName><params><param><value><string>not_a_real_key</string></value></param><param><value><i4>3606</i4></value></param><param><value><array><data><value><string>Id</string></value><value><string>FirstName</string></value><value><string>LastName</string></value><value><string>Email</string></value><value><string>Company</string></value></data></array></value></param></params></methodCall>
10
+ headers:
11
+ User-Agent:
12
+ - Infusionsoft-1.1.8 (RubyGem)
13
+ Content-Type:
14
+ - text/xml; charset=utf-8
15
+ Content-Length:
16
+ - '480'
17
+ Connection:
18
+ - keep-alive
19
+ Accept-Encoding:
20
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
21
+ Accept:
22
+ - "*/*"
23
+ response:
24
+ status:
25
+ code: 200
26
+ message: OK
27
+ headers:
28
+ Server:
29
+ - Apache-Coyote/1.1
30
+ Pragma:
31
+ - no-cache
32
+ Cache-Control:
33
+ - no-cache, no-store
34
+ Expires:
35
+ - Fri, 10 Apr 2015 19:15:07 GMT
36
+ Content-Type:
37
+ - text/xml;charset=UTF-8
38
+ Content-Length:
39
+ - '379'
40
+ Date:
41
+ - Fri, 10 Apr 2015 07:15:06 GMT
42
+ Set-Cookie:
43
+ - app-lb=2466578442.20480.0000; path=/
44
+ body:
45
+ encoding: UTF-8
46
+ string: <?xml version="1.0" encoding="utf-8"?><methodResponse><params><param><value><struct><member><name>Email</name><value>test@tester.com</value></member><member><name>FirstName</name><value>Severus</value></member><member><name>Id</name><value><i4>3606</i4></value></member><member><name>LastName</name><value>Snape</value></member></struct></value></param></params></methodResponse>
47
+ http_version:
48
+ recorded_at: Fri, 10 Apr 2015 07:15:07 GMT
49
+ - request:
50
+ method: post
51
+ uri: https://test.infusionsoft.com/api/xmlrpc
52
+ body:
53
+ encoding: UTF-8
54
+ string: |
55
+ <?xml version="1.0" ?><methodCall><methodName>ContactService.addWithDupCheck</methodName><params><param><value><string>not_a_real_key</string></value></param><param><value><struct><member><name>Email</name><value><string>test@tester.com</string></value></member><member><name>FirstName</name><value><string>Severus</string></value></member><member><name>LastName</name><value><string>Snape</string></value></member><member><name>Company</name><value><string>Test Company</string></value></member></struct></value></param><param><value><string>EmailAndName</string></value></param></params></methodCall>
56
+ headers:
57
+ User-Agent:
58
+ - Infusionsoft-1.1.8 (RubyGem)
59
+ Content-Type:
60
+ - text/xml; charset=utf-8
61
+ Content-Length:
62
+ - '621'
63
+ Connection:
64
+ - keep-alive
65
+ Accept-Encoding:
66
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
67
+ Accept:
68
+ - "*/*"
69
+ response:
70
+ status:
71
+ code: 200
72
+ message: OK
73
+ headers:
74
+ Server:
75
+ - Apache-Coyote/1.1
76
+ Pragma:
77
+ - no-cache
78
+ Cache-Control:
79
+ - no-cache, no-store
80
+ Expires:
81
+ - Fri, 10 Apr 2015 19:15:07 GMT
82
+ Content-Type:
83
+ - text/xml;charset=UTF-8
84
+ Content-Length:
85
+ - '131'
86
+ Date:
87
+ - Fri, 10 Apr 2015 07:15:06 GMT
88
+ Set-Cookie:
89
+ - app-lb=2466578442.20480.0000; path=/
90
+ body:
91
+ encoding: UTF-8
92
+ string: <?xml version="1.0" encoding="utf-8"?><methodResponse><params><param><value><i4>3606</i4></value></param></params></methodResponse>
93
+ http_version:
94
+ recorded_at: Fri, 10 Apr 2015 07:15:07 GMT
95
+ - request:
96
+ method: post
97
+ uri: https://test.infusionsoft.com/api/xmlrpc
98
+ body:
99
+ encoding: UTF-8
100
+ string: |
101
+ <?xml version="1.0" ?><methodCall><methodName>APIEmailService.optIn</methodName><params><param><value><string>not_a_real_key</string></value></param><param><value><string>testing@test.com</string></value></param><param><value><string>requested information</string></value></param></params></methodCall>
102
+ headers:
103
+ User-Agent:
104
+ - Infusionsoft-1.1.8 (RubyGem)
105
+ Content-Type:
106
+ - text/xml; charset=utf-8
107
+ Content-Length:
108
+ - '321'
109
+ Connection:
110
+ - keep-alive
111
+ Accept:
112
+ - "*/*"
113
+ response:
114
+ status:
115
+ code: 200
116
+ message: OK
117
+ headers:
118
+ Server:
119
+ - Apache-Coyote/1.1
120
+ Pragma:
121
+ - no-cache
122
+ Cache-Control:
123
+ - no-cache, no-store
124
+ Expires:
125
+ - Fri, 31 Jul 2015 11:55:20 GMT
126
+ Content-Type:
127
+ - text/xml;charset=UTF-8
128
+ Content-Length:
129
+ - '138'
130
+ Date:
131
+ - Thu, 30 Jul 2015 23:55:20 GMT
132
+ Set-Cookie:
133
+ - app-lb=2466578442.20480.0000; path=/
134
+ body:
135
+ encoding: US-ASCII
136
+ string: <?xml version="1.0" encoding="utf-8"?><methodResponse><params><param><value><boolean>1</boolean></value></param></params></methodResponse>
137
+ http_version:
138
+ recorded_at: Thu, 30 Jul 2015 23:55:21 GMT
139
+ - request:
140
+ method: post
141
+ uri: https://test.infusionsoft.com/api/xmlrpc
142
+ body:
143
+ encoding: UTF-8
144
+ string: |
145
+ <?xml version="1.0" ?><methodCall><methodName>ContactService.load</methodName><params><param><value><string>not_a_real_key</string></value></param><param><value><i4>3606</i4></value></param><param><value><array><data><value><string>Company</string></value></data></array></value></param></params></methodCall>
146
+ headers:
147
+ User-Agent:
148
+ - Infusionsoft-1.1.8 (RubyGem)
149
+ Content-Type:
150
+ - text/xml; charset=utf-8
151
+ Content-Length:
152
+ - '328'
153
+ Connection:
154
+ - keep-alive
155
+ Accept-Encoding:
156
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
157
+ Accept:
158
+ - "*/*"
159
+ response:
160
+ status:
161
+ code: 200
162
+ message: OK
163
+ headers:
164
+ Server:
165
+ - Apache-Coyote/1.1
166
+ Pragma:
167
+ - no-cache
168
+ Cache-Control:
169
+ - no-cache, no-store
170
+ Expires:
171
+ - Fri, 10 Apr 2015 19:15:07 GMT
172
+ Content-Type:
173
+ - text/xml;charset=UTF-8
174
+ Content-Length:
175
+ - '199'
176
+ Date:
177
+ - Fri, 10 Apr 2015 07:15:07 GMT
178
+ Set-Cookie:
179
+ - app-lb=2466578442.20480.0000; path=/
180
+ body:
181
+ encoding: UTF-8
182
+ string: <?xml version="1.0" encoding="utf-8"?><methodResponse><params><param><value><struct><member><name>Company</name><value>Test
183
+ Company</value></member></struct></value></param></params></methodResponse>
184
+ http_version:
185
+ recorded_at: Fri, 10 Apr 2015 07:15:07 GMT
186
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,49 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://test.infusionsoft.com/api/xmlrpc
6
+ body:
7
+ encoding: UTF-8
8
+ string: |
9
+ <?xml version="1.0" ?><methodCall><methodName>ContactService.load</methodName><params><param><value><string>not_a_real_key</string></value></param><param><value><i4>3606</i4></value></param><param><value><array><data><value><string>FirstName</string></value><value><string>LastName</string></value></data></array></value></param></params></methodCall>
10
+ headers:
11
+ User-Agent:
12
+ - Infusionsoft-1.1.8 (RubyGem)
13
+ Content-Type:
14
+ - text/xml; charset=utf-8
15
+ Content-Length:
16
+ - '370'
17
+ Connection:
18
+ - keep-alive
19
+ Accept-Encoding:
20
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
21
+ Accept:
22
+ - "*/*"
23
+ response:
24
+ status:
25
+ code: 200
26
+ message: OK
27
+ headers:
28
+ Server:
29
+ - Apache-Coyote/1.1
30
+ Pragma:
31
+ - no-cache
32
+ Cache-Control:
33
+ - no-cache, no-store
34
+ Expires:
35
+ - Fri, 10 Apr 2015 20:24:44 GMT
36
+ Content-Type:
37
+ - text/xml;charset=UTF-8
38
+ Content-Length:
39
+ - '254'
40
+ Date:
41
+ - Fri, 10 Apr 2015 08:24:44 GMT
42
+ Set-Cookie:
43
+ - app-lb=2466578442.20480.0000; path=/
44
+ body:
45
+ encoding: UTF-8
46
+ string: <?xml version="1.0" encoding="utf-8"?><methodResponse><params><param><value><struct><member><name>FirstName</name><value>Severus</value></member><member><name>LastName</name><value>Snape</value></member></struct></value></param></params></methodResponse>
47
+ http_version:
48
+ recorded_at: Fri, 10 Apr 2015 08:24:44 GMT
49
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,49 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://test.infusionsoft.com/api/xmlrpc
6
+ body:
7
+ encoding: UTF-8
8
+ string: |
9
+ <?xml version="1.0" ?><methodCall><methodName>ContactService.merge</methodName><params><param><value><string>not_a_real_key</string></value></param><param><value><i4>3602</i4></value></param><param><value><i4>3604</i4></value></param></params></methodCall>
10
+ headers:
11
+ User-Agent:
12
+ - Infusionsoft-1.1.8 (RubyGem)
13
+ Content-Type:
14
+ - text/xml; charset=utf-8
15
+ Content-Length:
16
+ - '275'
17
+ Connection:
18
+ - keep-alive
19
+ Accept-Encoding:
20
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
21
+ Accept:
22
+ - "*/*"
23
+ response:
24
+ status:
25
+ code: 200
26
+ message: OK
27
+ headers:
28
+ Server:
29
+ - Apache-Coyote/1.1
30
+ Pragma:
31
+ - no-cache
32
+ Cache-Control:
33
+ - no-cache, no-store
34
+ Expires:
35
+ - Thu, 09 Apr 2015 19:22:17 GMT
36
+ Content-Type:
37
+ - text/xml;charset=UTF-8
38
+ Content-Length:
39
+ - '138'
40
+ Date:
41
+ - Thu, 09 Apr 2015 07:22:16 GMT
42
+ Set-Cookie:
43
+ - app-lb=2466578442.20480.0000; path=/
44
+ body:
45
+ encoding: UTF-8
46
+ string: <?xml version="1.0" encoding="utf-8"?><methodResponse><params><param><value><boolean>1</boolean></value></param></params></methodResponse>
47
+ http_version:
48
+ recorded_at: Thu, 09 Apr 2015 07:22:17 GMT
49
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,95 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://test.infusionsoft.com/api/xmlrpc
6
+ body:
7
+ encoding: UTF-8
8
+ string: |
9
+ <?xml version="1.0" ?><methodCall><methodName>ContactService.update</methodName><params><param><value><string>not_a_real_key</string></value></param><param><value><i4>3606</i4></value></param><param><value><struct><member><name>Company</name><value><string>Hogwarts</string></value></member></struct></value></param></params></methodCall>
10
+ headers:
11
+ User-Agent:
12
+ - Infusionsoft-1.1.8 (RubyGem)
13
+ Content-Type:
14
+ - text/xml; charset=utf-8
15
+ Content-Length:
16
+ - '357'
17
+ Connection:
18
+ - keep-alive
19
+ Accept-Encoding:
20
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
21
+ Accept:
22
+ - "*/*"
23
+ response:
24
+ status:
25
+ code: 200
26
+ message: OK
27
+ headers:
28
+ Server:
29
+ - Apache-Coyote/1.1
30
+ Pragma:
31
+ - no-cache
32
+ Cache-Control:
33
+ - no-cache, no-store
34
+ Expires:
35
+ - Fri, 10 Apr 2015 20:18:59 GMT
36
+ Content-Type:
37
+ - text/xml;charset=UTF-8
38
+ Content-Length:
39
+ - '131'
40
+ Date:
41
+ - Fri, 10 Apr 2015 08:18:59 GMT
42
+ Set-Cookie:
43
+ - app-lb=2466578442.20480.0000; path=/
44
+ body:
45
+ encoding: UTF-8
46
+ string: <?xml version="1.0" encoding="utf-8"?><methodResponse><params><param><value><i4>3606</i4></value></param></params></methodResponse>
47
+ http_version:
48
+ recorded_at: Fri, 10 Apr 2015 08:18:59 GMT
49
+ - request:
50
+ method: post
51
+ uri: https://test.infusionsoft.com/api/xmlrpc
52
+ body:
53
+ encoding: UTF-8
54
+ string: |
55
+ <?xml version="1.0" ?><methodCall><methodName>ContactService.load</methodName><params><param><value><string>not_a_real_key</string></value></param><param><value><i4>3606</i4></value></param><param><value><array><data><value><string>Company</string></value></data></array></value></param></params></methodCall>
56
+ headers:
57
+ User-Agent:
58
+ - Infusionsoft-1.1.8 (RubyGem)
59
+ Content-Type:
60
+ - text/xml; charset=utf-8
61
+ Content-Length:
62
+ - '328'
63
+ Connection:
64
+ - keep-alive
65
+ Accept-Encoding:
66
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
67
+ Accept:
68
+ - "*/*"
69
+ response:
70
+ status:
71
+ code: 200
72
+ message: OK
73
+ headers:
74
+ Server:
75
+ - Apache-Coyote/1.1
76
+ Pragma:
77
+ - no-cache
78
+ Cache-Control:
79
+ - no-cache, no-store
80
+ Expires:
81
+ - Fri, 10 Apr 2015 20:19:00 GMT
82
+ Content-Type:
83
+ - text/xml;charset=UTF-8
84
+ Content-Length:
85
+ - '195'
86
+ Date:
87
+ - Fri, 10 Apr 2015 08:18:59 GMT
88
+ Set-Cookie:
89
+ - app-lb=2466578442.20480.0000; path=/
90
+ body:
91
+ encoding: UTF-8
92
+ string: <?xml version="1.0" encoding="utf-8"?><methodResponse><params><param><value><struct><member><name>Company</name><value>Hogwarts</value></member></struct></value></param></params></methodResponse>
93
+ http_version:
94
+ recorded_at: Fri, 10 Apr 2015 08:19:00 GMT
95
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,49 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://test.infusionsoft.com/api/xmlrpc
6
+ body:
7
+ encoding: UTF-8
8
+ string: |
9
+ <?xml version="1.0" ?><methodCall><methodName>DataService.add</methodName><params><param><value><string>not_a_real_key</string></value></param><param><value><string>Company</string></value></param><param><value><struct><member><name>Company</name><value><string>Hogwarts of America</string></value></member><member><name>Phone1</name><value><string>123-456-7899</string></value></member><member><name>Website</name><value><string>http://hogwarts-usa.com</string></value></member><member><name>StreetAddress1</name><value><string>123 Wizard Ave.</string></value></member><member><name>City</name><value><string>Redmond</string></value></member><member><name>State</name><value><string>WA</string></value></member><member><name>PostalCode</name><value><string>98052</string></value></member><member><name>Country</name><value><string>United States</string></value></member></struct></value></param></params></methodCall>
10
+ headers:
11
+ User-Agent:
12
+ - Infusionsoft-1.1.8 (RubyGem)
13
+ Content-Type:
14
+ - text/xml; charset=utf-8
15
+ Content-Length:
16
+ - '937'
17
+ Connection:
18
+ - keep-alive
19
+ Accept-Encoding:
20
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
21
+ Accept:
22
+ - "*/*"
23
+ response:
24
+ status:
25
+ code: 200
26
+ message: OK
27
+ headers:
28
+ Server:
29
+ - Apache-Coyote/1.1
30
+ Pragma:
31
+ - no-cache
32
+ Cache-Control:
33
+ - no-cache, no-store
34
+ Expires:
35
+ - Sun, 12 Apr 2015 05:34:01 GMT
36
+ Content-Type:
37
+ - text/xml;charset=UTF-8
38
+ Content-Length:
39
+ - '131'
40
+ Date:
41
+ - Sat, 11 Apr 2015 17:34:00 GMT
42
+ Set-Cookie:
43
+ - app-lb=2466578442.20480.0000; path=/
44
+ body:
45
+ encoding: UTF-8
46
+ string: <?xml version="1.0" encoding="utf-8"?><methodResponse><params><param><value><i4>3620</i4></value></param></params></methodResponse>
47
+ http_version:
48
+ recorded_at: Sat, 11 Apr 2015 17:34:00 GMT
49
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,49 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://test.infusionsoft.com/api/xmlrpc
6
+ body:
7
+ encoding: UTF-8
8
+ string: |
9
+ <?xml version="1.0" ?><methodCall><methodName>DataService.addCustomField</methodName><params><param><value><string>not_a_real_key</string></value></param><param><value><string>Company</string></value></param><param><value><string>Awesomeness Level</string></value></param><param><value><string>Text</string></value></param><param><value><i4>4</i4></value></param></params></methodCall>
10
+ headers:
11
+ User-Agent:
12
+ - Infusionsoft-1.1.8 (RubyGem)
13
+ Content-Type:
14
+ - text/xml; charset=utf-8
15
+ Content-Length:
16
+ - '404'
17
+ Connection:
18
+ - keep-alive
19
+ Accept-Encoding:
20
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
21
+ Accept:
22
+ - "*/*"
23
+ response:
24
+ status:
25
+ code: 200
26
+ message: OK
27
+ headers:
28
+ Server:
29
+ - Apache-Coyote/1.1
30
+ Pragma:
31
+ - no-cache
32
+ Cache-Control:
33
+ - no-cache, no-store
34
+ Expires:
35
+ - Sun, 12 Apr 2015 11:09:25 GMT
36
+ Content-Type:
37
+ - text/xml;charset=UTF-8
38
+ Content-Length:
39
+ - '129'
40
+ Date:
41
+ - Sat, 11 Apr 2015 23:09:25 GMT
42
+ Set-Cookie:
43
+ - app-lb=2466578442.20480.0000; path=/
44
+ body:
45
+ encoding: UTF-8
46
+ string: <?xml version="1.0" encoding="utf-8"?><methodResponse><params><param><value><i4>16</i4></value></param></params></methodResponse>
47
+ http_version:
48
+ recorded_at: Sat, 11 Apr 2015 23:09:25 GMT
49
+ recorded_with: VCR 2.9.3