telesignature 0.0.7 → 0.0.8

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
  SHA1:
3
- metadata.gz: ee169bfd2307fa6994c9b40c08fbbdb29508feaf
4
- data.tar.gz: 3cdbb04ef63b532e3f7d3eefb4074ab0585f3cf6
3
+ metadata.gz: 94668e3da3625dea16f5997838d09a3d4099e363
4
+ data.tar.gz: f6e7c953d1163107308a736f203e901361e2a660
5
5
  SHA512:
6
- metadata.gz: af79fa44c17b3892f7deb0f604c4204ac876058a0c905c4fce2022f5702f11df124c8f302b85f2a97c26be0a371932be54e6d5d295c941f192d81c358353ca12
7
- data.tar.gz: e07bb0e4dea327370e758f6c88a9acc92723b65eddcd2f1f4df9d256cbbb9787e24edddb2b47184e3782ba00c63912fa82a7fb7edc4d0ca1722e8d0fe2be77f5
6
+ metadata.gz: b54e7050d8940a7f609d73fa330dcb6982effadcb172acbf9cc435885476c09038ed07dd6467133591bbc366c9dfa86e25c5b8280f7e350cd3f2bddd29d51779
7
+ data.tar.gz: 6a5e81993fbb982bd1db426bd4e75f8426a5c0c61ae68206b9102d852deecc186bfc6a2e3c017c89c266e6ba54e61695d43f934fed212e974808758462513819
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- telesignature (0.0.7)
4
+ telesignature (0.0.8)
5
5
  faraday
6
6
 
7
7
  GEM
@@ -3,10 +3,6 @@ module Telesignature
3
3
  # """
4
4
  # Either the client failed to authenticate with the REST API server, or the service cannot be executed using the specified credentials.
5
5
 
6
- # .. list-table::
7
- # :widths: 5 30
8
- # :header-rows: 1
9
-
10
6
  # * - Attributes
11
7
  # -
12
8
  # * - `data`
@@ -4,10 +4,6 @@ module Telesignature
4
4
  # """
5
5
  # The **PhoneId** class exposes three services that each provide detailed information about a specified phone number.
6
6
 
7
- # .. list-table::
8
- # :widths: 5 30
9
- # :header-rows: 1
10
-
11
7
  # * - Attributes
12
8
  # -
13
9
  # * - `customer_id`
@@ -37,22 +33,20 @@ module Telesignature
37
33
 
38
34
  def standard phone_number
39
35
  # """
40
- # Retrieves the standard set of details about the specified phone number. This includes the type of phone (e.g., land line or mobile), and it's approximate geographic location.
41
-
42
- # .. list-table::
43
- # :widths: 5 30
44
- # :header-rows: 1
36
+ # Retrieves the standard set of details about the specified phone number.
37
+ # This includes the type of phone (e.g., land line or mobile),
38
+ # and it's approximate geographic location.
45
39
 
46
40
  # * - Parameters
47
41
  # -
48
42
  # * - `phone_number`
49
- # - The phone number you want details about. You must specify the phone number in its entirety. That is, it must begin with the country code, followed by the area code, and then by the local number. For example, you would specify the phone number (310) 555-1212 as 13105551212.
43
+ # - The phone number you want details about. You must specify the phone number
44
+ # in its entirety. That is, it must begin with the country code, followed by
45
+ # the area code, and then by the local number.
46
+ # For example, you would specify the phone number (310) 555-1212 as 13105551212.
50
47
 
51
48
  # **Example**::
52
49
 
53
- # from telesign.api import PhoneId
54
- # from telesign.exceptions import AuthorizationError, TelesignError
55
-
56
50
  # cust_id = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890"
57
51
  # secret_key = "EXAMPLE----TE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw=="
58
52
  # phone_number = "13107409700"
@@ -92,45 +86,26 @@ module Telesignature
92
86
 
93
87
  def score phone_number, use_case_code
94
88
  # """
95
- # Retrieves a score for the specified phone number. This ranks the phone number's "risk level" on a scale from 0 to 1000, so you can code your web application to handle particular use cases (e.g., to stop things like chargebacks, identity theft, fraud, and spam).
96
-
97
- # .. list-table::
98
- # :widths: 5 30
99
- # :header-rows: 1
89
+ # Retrieves a score for the specified phone number.
90
+ # This ranks the phone number's "risk level" on a scale from 0 to 1000,
91
+ # so you can code your web application to handle particular use cases
92
+ # (e.g., to stop things like chargebacks, identity theft, fraud, and spam).
100
93
 
101
94
  # * - Parameters
102
95
  # -
103
96
  # * - `phone_number`
104
- # - The phone number you want details about. You must specify the phone number in its entirety. That is, it must begin with the country code, followed by the area code, and then by the local number. For example, you would specify the phone number (310) 555-1212 as 13105551212.
97
+ # - The phone number you want details about. You must specify the phone number in its entirety.
98
+ # That is, it must begin with the country code, followed by the area code, and then by the local number.
99
+ # For example, you would specify the phone number (310) 555-1212 as 13105551212.
105
100
  # * - `use_case_code`
106
101
  # - A four letter code used to specify a particular usage scenario for the web service.
107
102
 
108
- # .. rubric:: Use-case Codes
109
-
110
103
  # The following table list the available use-case codes, and includes a description of each.
111
104
 
112
- # ======== =====================================
113
- # Code Description
114
- # ======== =====================================
115
- # **BACS** Prevent bulk account creation + spam.
116
- # **BACF** Prevent bulk account creation + fraud.
117
- # **CHBK** Prevent chargebacks.
118
- # **ATCK** Prevent account takeover/compromise.
119
- # **LEAD** Prevent false lead entry.
120
- # **RESV** Prevent fake/missed reservations.
121
- # **PWRT** Password reset.
122
- # **THEF** Prevent identity theft.
123
- # **TELF** Prevent telecom fraud.
124
- # **RXPF** Prevent prescription fraud.
125
- # **OTHR** Other.
126
- # **UNKN** Unknown/prefer not to say.
127
- # ======== =====================================
105
+ # http://docs.telesign.com/rest/content/xt/xt-use-case-codes.html#xref-use-case-codes
128
106
 
129
107
  # **Example**::
130
108
 
131
- # from telesign.api import PhoneId
132
- # from telesign.exceptions import AuthorizationError, TelesignError
133
-
134
109
  # cust_id = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890"
135
110
  # secret_key = "EXAMPLE----TE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw=="
136
111
  # phone_number = "13107409700"
@@ -167,11 +142,8 @@ module Telesignature
167
142
 
168
143
  def contact phone_number, use_case_code
169
144
  # """
170
- # In addition to the information retrieved by **standard**, this service provides the Name & Address associated with the specified phone number.
171
-
172
- # .. list-table::
173
- # :widths: 5 30
174
- # :header-rows: 1
145
+ # In addition to the information retrieved by **standard**,
146
+ # this service provides the Name & Address associated with the specified phone number.
175
147
 
176
148
  # * - Parameters
177
149
  # -
@@ -180,32 +152,10 @@ module Telesignature
180
152
  # * - `use_case_code`
181
153
  # - A four letter code used to specify a particular usage scenario for the web service.
182
154
 
183
- # .. rubric:: Use-case Codes
184
-
185
- # The following table list the available use-case codes, and includes a description of each.
186
-
187
- # ======== =====================================
188
- # Code Description
189
- # ======== =====================================
190
- # **BACS** Prevent bulk account creation + spam.
191
- # **BACF** Prevent bulk account creation + fraud.
192
- # **CHBK** Prevent chargebacks.
193
- # **ATCK** Prevent account takeover/compromise.
194
- # **LEAD** Prevent false lead entry.
195
- # **RESV** Prevent fake/missed reservations.
196
- # **PWRT** Password reset.
197
- # **THEF** Prevent identity theft.
198
- # **TELF** Prevent telecom fraud.
199
- # **RXPF** Prevent prescription fraud.
200
- # **OTHR** Other.
201
- # **UNKN** Unknown/prefer not to say.
202
- # ======== =====================================
155
+ # http://docs.telesign.com/rest/content/xt/xt-use-case-codes.html#xref-use-case-codes
203
156
 
204
157
  # **Example**::
205
158
 
206
- # from telesign.api import PhoneId
207
- # from telesign.exceptions import AuthorizationError, TelesignError
208
-
209
159
  # cust_id = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890"
210
160
  # secret_key = "EXAMPLE----TE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw=="
211
161
  # phone_number = "13107409700"
@@ -245,45 +195,25 @@ module Telesignature
245
195
 
246
196
  def live phone_number, use_case_code
247
197
  # """
248
- # In addition to the information retrieved by **standard**, this service provides actionable data associated with the specified phone number.
249
-
250
- # .. list-table::
251
- # :widths: 5 30
252
- # :header-rows: 1
198
+ # In addition to the information retrieved by **standard**,
199
+ # this service provides actionable data associated with the specified phone number.
253
200
 
254
201
  # * - Parameters
255
202
  # -
256
203
  # * - `phone_number`
257
- # - The phone number you want details about. You must specify the phone number in its entirety. That is, it must begin with the country code, followed by the area code, and then by the local number. For example, you would specify the phone number (310) 555-1212 as 13105551212.
204
+ # - The phone number you want details about. You must specify the phone number in its entirety.
205
+ # That is, it must begin with the country code, followed by the area code,
206
+ # and then by the local number.
207
+ # For example, you would specify the phone number (310) 555-1212 as 13105551212.
258
208
  # * - `use_case_code`
259
209
  # - A four letter code used to specify a particular usage scenario for the web service.
260
210
 
261
- # .. rubric:: Use-case Codes
262
-
263
211
  # The following table list the available use-case codes, and includes a description of each.
264
212
 
265
- # ======== =====================================
266
- # Code Description
267
- # ======== =====================================
268
- # **BACS** Prevent bulk account creation + spam.
269
- # **BACF** Prevent bulk account creation + fraud.
270
- # **CHBK** Prevent chargebacks.
271
- # **ATCK** Prevent account takeover/compromise.
272
- # **LEAD** Prevent false lead entry.
273
- # **RESV** Prevent fake/missed reservations.
274
- # **PWRT** Password reset.
275
- # **THEF** Prevent identity theft.
276
- # **TELF** Prevent telecom fraud.
277
- # **RXPF** Prevent prescription fraud.
278
- # **OTHR** Other.
279
- # **UNKN** Unknown/prefer not to say.
280
- # ======== =====================================
213
+ # http://docs.telesign.com/rest/content/xt/xt-use-case-codes.html#xref-use-case-codes
281
214
 
282
215
  # **Example**::
283
216
 
284
- # from telesign.api import PhoneId
285
- # from telesign.exceptions import AuthorizationError, TelesignError
286
-
287
217
  # cust_id = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890"
288
218
  # secret_key = "EXAMPLE----TE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw=="
289
219
  # phone_number = "13107409700"
@@ -27,9 +27,9 @@ module Telesignature
27
27
  resp_obj = JSON.load response.body
28
28
  if response.status != 200
29
29
  if response.status == 401
30
- raise AuthorizationError.new resp_obj, response
30
+ raise AuthorizationError.new resp_obj['errors'], response
31
31
  else
32
- raise TelesignError.new resp_obj, response
32
+ raise TelesignError.new resp_obj['errors'], response
33
33
  end
34
34
  end
35
35
 
@@ -20,15 +20,14 @@ module Telesignature
20
20
 
21
21
  def initialize errors, http_response
22
22
  @errors = errors
23
- @headers = http_response[:headers]
24
- @status = http_response[:status_code]
25
- @data = http_response[:text]
26
- @raw_data = http_response[:text]
23
+ @headers = http_response.headers
24
+ @status = http_response.status
25
+ @data = http_response.body
27
26
  super()
28
27
  end
29
28
 
30
29
  def to_s
31
- @errors.inject(''){|ret, x| ret += "%s\n" % x[:description] }
30
+ @errors.inject(''){|ret, x| ret += "#{x['description']}\n" }
32
31
  end
33
32
  end
34
33
  end
@@ -3,10 +3,6 @@ module Telesignature
3
3
  # """
4
4
  # The submitted data failed the intial validation, and the service was not executed.
5
5
 
6
- # .. list-table::
7
- # :widths: 5 30
8
- # :header-rows: 1
9
-
10
6
  # * - Attributes
11
7
  # -
12
8
  # * - `data`
@@ -1,3 +1,3 @@
1
1
  module Telesignature
2
- VERSION = '0.0.7'
2
+ VERSION = '0.0.8'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telesignature
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Koch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-12 00:00:00.000000000 Z
11
+ date: 2014-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday