lob 3.0.0 → 4.0.0

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: 37c8b30c17f9f1e2bf17d7fb3030e6a5f503ed08
4
- data.tar.gz: f3be769fb4eb543072f637e89c5a2a382391872b
3
+ metadata.gz: 98855f792febf3dad2f0d885fb55f1995faea52f
4
+ data.tar.gz: a630435538c358b6c2bb72caae28490e588ea94d
5
5
  SHA512:
6
- metadata.gz: 83785a95d0f3bed197b7ce4f89269b8c695715f5aafc1591651229ed2ffe47888209097320919befa9a20b25d17ec5a72b77a496b69ca648bb6f543248c85365
7
- data.tar.gz: 20bca49d8ab6271f0c4c9b0186aa55e3b4a2dc8277b68bc2795f01477b426185589e465afab92697c809a605cb8b7d016a5876ef8cf078e1592c052be84c0daf
6
+ metadata.gz: bc028726b431293f20f313ed6852e8e08de864dff3e7bfe016422801991d8d171e8d05d173628d6c2e880c93729e35f17cd0e5eb41b707dd361b7ca50a25e410
7
+ data.tar.gz: 7b95754a03c640da8c37967286820883105c58f90d5d1ffbfd1342a2f1cd92e8a4e5523914d60e04899dbe700d62ac32df6e0cf2a3168b4fcdbda07450dd903c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 4.0.0
2
+
3
+ Version 4.0.0 introduces a breaking change. It requires a minimum API version of `2017-05-17`, which introduces new US and International Verification APIs.
4
+
5
+ * Removes `Lob.addresses.verify()`. Please use `Lob.us_verifications.verify()` and `Lob.intl_verifications.verify() instead.
6
+
1
7
  ## 3.0.0
2
8
 
3
9
  Version 3.0.0 introduces several breaking changes. It requires a minimum API version of `2015-04-11`.
data/README.md CHANGED
@@ -29,7 +29,7 @@ Here's a general overview of the Lob services available, click through to read m
29
29
  - [Letters API](https://lob.com/services/letters)
30
30
  - [Checks API](https://lob.com/services/checks)
31
31
  - [Area Mail API](https://lob.com/services/area)
32
- - [Address Verification API](https://lob.com/verification/address)
32
+ - [Address Verification API](https://lob.com/services/verifications)
33
33
 
34
34
  ### Registration
35
35
 
@@ -115,6 +115,7 @@ There are simple scripts to demonstrate how to create all the core Lob products
115
115
  - [Versioning](https://lob.com/docs/ruby#version)
116
116
  - [Errors](https://lob.com/docs/ruby#errors)
117
117
  - [Rate Limiting](https://lob.com/docs/ruby#rate-limits)
118
+ - [Webhooks](https://lob.com/docs/ruby#webhooks)
118
119
  - [Metadata](https://lob.com/docs/ruby#metadata)
119
120
  - [Asset URLs](https://lob.com/docs/ruby#urls)
120
121
  - **Addresses**
@@ -124,8 +125,13 @@ There are simple scripts to demonstrate how to create all the core Lob products
124
125
  - [Retrieve an Address](https://lob.com/docs/ruby#addresses_retrieve)
125
126
  - [Delete an Address](https://lob.com/docs/ruby#addresses_delete)
126
127
  - [List all Addresses](https://lob.com/docs/ruby#addresses_list)
127
- - [Address Verification API](https://lob.com/docs/ruby#verify)
128
- - [Verify an Address](https://lob.com/docs/ruby#verify_create)
128
+ - **US Verification API**
129
+ - [US Verifications](https://lob.com/docs/ruby#us_verifications)
130
+ - [The US Verifications Object](https://lob.com/docs/ruby#us_verifications_object)
131
+ - [Verify a US address](https://lob.com/docs/ruby#us_verifications_create)
132
+ - **Int'l Verification API**
133
+ - [International Verifications](https://lob.com/docs/ruby#intl_verifications)
134
+ - [Verify an int'l address](https://lob.com/docs/ruby#intl_verifications_create)
129
135
  - **Postcards API**
130
136
  - [Postcards](https://lob.com/docs/ruby#postcards)
131
137
  - [The Postcard Object](https://lob.com/docs/ruby#postcards_object)
@@ -169,8 +175,10 @@ There are simple scripts to demonstrate how to create all the core Lob products
169
175
  - **Appendix**
170
176
  - [API Changelog](https://lob.com/docs/ruby#changelog)
171
177
  - [The Tracking Event Object](https://lob.com/docs/ruby#tracking_event_object)
178
+ - [Events](https://lob.com/docs/ruby#events)
172
179
  - [HTML Examples](https://lob.com/docs/ruby#html-examples)
173
180
  - [Image Prepping](https://lob.com/docs/ruby#prepping)
181
+ - [US Verification Details](https://lob.com/docs/ruby#us_verification_details)
174
182
 
175
183
  ## Contributing
176
184
 
data/lib/lob/client.rb CHANGED
@@ -3,10 +3,12 @@ require "lob/resources/area"
3
3
  require "lob/resources/bank_account"
4
4
  require "lob/resources/check"
5
5
  require "lob/resources/country"
6
+ require "lob/resources/intl_verifications"
6
7
  require "lob/resources/letter"
7
8
  require "lob/resources/postcard"
8
9
  require "lob/resources/route"
9
10
  require "lob/resources/state"
11
+ require "lob/resources/us_verifications"
10
12
 
11
13
  module Lob
12
14
  class Client
@@ -41,6 +43,10 @@ module Lob
41
43
  Lob::Resources::Country.new(config)
42
44
  end
43
45
 
46
+ def intl_verifications
47
+ Lob::Resources::IntlVerifications.new(config)
48
+ end
49
+
44
50
  def letters
45
51
  Lob::Resources::Letter.new(config)
46
52
  end
@@ -57,5 +63,9 @@ module Lob
57
63
  Lob::Resources::State.new(config)
58
64
  end
59
65
 
66
+ def us_verifications
67
+ Lob::Resources::USVerifications.new(config)
68
+ end
69
+
60
70
  end
61
71
  end
@@ -9,16 +9,6 @@ module Lob
9
9
  @endpoint = "addresses"
10
10
  end
11
11
 
12
- def verify(options={})
13
- submit :post, address_verify_url, options
14
- end
15
-
16
- private
17
-
18
- def address_verify_url
19
- "#{base_url}/verify"
20
- end
21
-
22
12
  end
23
13
  end
24
14
  end
@@ -0,0 +1,20 @@
1
+ require "lob/resources/resource_base"
2
+
3
+ module Lob
4
+ module Resources
5
+ class IntlVerifications < Lob::Resources::ResourceBase
6
+
7
+ undef_method :list, :find, :create, :destroy
8
+
9
+ def initialize(config)
10
+ super(config)
11
+ @endpoint = "intl_verifications"
12
+ end
13
+
14
+ def verify(options={})
15
+ submit :post, endpoint_url, options
16
+ end
17
+
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,20 @@
1
+ require "lob/resources/resource_base"
2
+
3
+ module Lob
4
+ module Resources
5
+ class USVerifications < Lob::Resources::ResourceBase
6
+
7
+ undef_method :list, :find, :create, :destroy
8
+
9
+ def initialize(config)
10
+ super(config)
11
+ @endpoint = "us_verifications"
12
+ end
13
+
14
+ def verify(options={})
15
+ submit :post, endpoint_url, options
16
+ end
17
+
18
+ end
19
+ end
20
+ end
data/lib/lob/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lob
2
- VERSION = "3.0.0"
2
+ VERSION = "4.0.0"
3
3
  end
@@ -18,21 +18,6 @@ describe Lob::Resources::Address do
18
18
 
19
19
  subject { Lob::Client.new(api_key: API_KEY) }
20
20
 
21
- describe "verify" do
22
-
23
- it "should verify an address" do
24
- result = subject.addresses.verify(
25
- address_line1: @sample_params[:address_line1],
26
- address_city: @sample_params[:address_city],
27
- address_state: @sample_params[:address_state],
28
- address_zip: @sample_params[:address_zip]
29
- )
30
-
31
- result["address"]["address_country"].must_equal("US")
32
- end
33
- end
34
-
35
-
36
21
  describe "list" do
37
22
  it "should list addresses" do
38
23
  assert subject.addresses.list["object"] == "list"
@@ -0,0 +1,28 @@
1
+ require "spec_helper"
2
+
3
+ describe Lob::Resources::IntlVerifications do
4
+
5
+ before :each do
6
+ @sample_params = {
7
+ address_line1: "123 Test St",
8
+ address_city: "HEARST",
9
+ address_state: "ONTARIO",
10
+ address_zip: "P0L1N0",
11
+ address_country: "CA"
12
+ }
13
+ end
14
+
15
+ subject { Lob::Client.new(api_key: API_KEY) }
16
+
17
+ describe "verify" do
18
+ it "should return a 403 in test mode" do
19
+ begin
20
+ subject.intl_verifications.verify @sample_params
21
+ rescue Lob::InvalidRequestError => e
22
+ assert e.http_status == 403
23
+ assert e._response.headers.include?(:content_type)
24
+ end
25
+ end
26
+ end
27
+
28
+ end
@@ -0,0 +1,27 @@
1
+ require "spec_helper"
2
+
3
+ describe Lob::Resources::USVerifications do
4
+
5
+ before :each do
6
+ @sample_params = {
7
+ recipient: "LOB.COM",
8
+ primary_line: "185 BERRY ST STE 6600",
9
+ city: "SAN FRANCISCO",
10
+ state: "CA",
11
+ zip_code: "94107"
12
+ }
13
+ end
14
+
15
+ subject { Lob::Client.new(api_key: API_KEY) }
16
+
17
+ describe "verify" do
18
+ it "should verify a US address" do
19
+ result = subject.us_verifications.verify @sample_params
20
+
21
+ result["recipient"].must_equal(@sample_params[:recipient])
22
+ result["primary_line"].must_equal(@sample_params[:primary_line])
23
+ result["last_line"].must_equal("SAN FRANCISCO CA 94107-1728")
24
+ end
25
+ end
26
+
27
+ end
metadata CHANGED
@@ -1,145 +1,145 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lob
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lob
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-11 00:00:00.000000000 Z
11
+ date: 2017-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rest-client
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
- - - ">="
16
+ - - '>='
18
17
  - !ruby/object:Gem::Version
19
18
  version: '1.8'
20
- - - "<"
19
+ - - <
21
20
  - !ruby/object:Gem::Version
22
21
  version: '3.0'
23
- type: :runtime
22
+ name: rest-client
24
23
  prerelease: false
24
+ type: :runtime
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - ">="
27
+ - - '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: '1.8'
30
- - - "<"
30
+ - - <
31
31
  - !ruby/object:Gem::Version
32
32
  version: '3.0'
33
33
  - !ruby/object:Gem::Dependency
34
- name: bundler
35
34
  requirement: !ruby/object:Gem::Requirement
36
35
  requirements:
37
- - - "~>"
36
+ - - ~>
38
37
  - !ruby/object:Gem::Version
39
38
  version: '1.3'
40
- type: :development
39
+ name: bundler
41
40
  prerelease: false
41
+ type: :development
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - "~>"
44
+ - - ~>
45
45
  - !ruby/object:Gem::Version
46
46
  version: '1.3'
47
47
  - !ruby/object:Gem::Dependency
48
- name: rake
49
48
  requirement: !ruby/object:Gem::Requirement
50
49
  requirements:
51
- - - "~>"
50
+ - - ~>
52
51
  - !ruby/object:Gem::Version
53
52
  version: 10.4.2
54
- type: :development
53
+ name: rake
55
54
  prerelease: false
55
+ type: :development
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - "~>"
58
+ - - ~>
59
59
  - !ruby/object:Gem::Version
60
60
  version: 10.4.2
61
61
  - !ruby/object:Gem::Dependency
62
- name: minitest
63
62
  requirement: !ruby/object:Gem::Requirement
64
63
  requirements:
65
- - - "~>"
64
+ - - ~>
66
65
  - !ruby/object:Gem::Version
67
66
  version: 5.6.1
68
- type: :development
67
+ name: minitest
69
68
  prerelease: false
69
+ type: :development
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - "~>"
72
+ - - ~>
73
73
  - !ruby/object:Gem::Version
74
74
  version: 5.6.1
75
75
  - !ruby/object:Gem::Dependency
76
- name: webmock
77
76
  requirement: !ruby/object:Gem::Requirement
78
77
  requirements:
79
- - - "~>"
78
+ - - ~>
80
79
  - !ruby/object:Gem::Version
81
80
  version: '1.2'
82
- type: :development
81
+ name: webmock
83
82
  prerelease: false
83
+ type: :development
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - "~>"
86
+ - - ~>
87
87
  - !ruby/object:Gem::Version
88
88
  version: '1.2'
89
89
  - !ruby/object:Gem::Dependency
90
- name: travis-lint
91
90
  requirement: !ruby/object:Gem::Requirement
92
91
  requirements:
93
- - - "~>"
92
+ - - ~>
94
93
  - !ruby/object:Gem::Version
95
94
  version: 2.0.0
96
- type: :development
95
+ name: travis-lint
97
96
  prerelease: false
97
+ type: :development
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
- - - "~>"
100
+ - - ~>
101
101
  - !ruby/object:Gem::Version
102
102
  version: 2.0.0
103
103
  - !ruby/object:Gem::Dependency
104
- name: coveralls
105
104
  requirement: !ruby/object:Gem::Requirement
106
105
  requirements:
107
- - - "~>"
106
+ - - ~>
108
107
  - !ruby/object:Gem::Version
109
108
  version: 0.8.1
110
- type: :development
109
+ name: coveralls
111
110
  prerelease: false
111
+ type: :development
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
- - - "~>"
114
+ - - ~>
115
115
  - !ruby/object:Gem::Version
116
116
  version: 0.8.1
117
117
  - !ruby/object:Gem::Dependency
118
- name: simplecov
119
118
  requirement: !ruby/object:Gem::Requirement
120
119
  requirements:
121
- - - "~>"
120
+ - - ~>
122
121
  - !ruby/object:Gem::Version
123
122
  version: 0.10.0
124
- type: :development
123
+ name: simplecov
125
124
  prerelease: false
125
+ type: :development
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  requirements:
128
- - - "~>"
128
+ - - ~>
129
129
  - !ruby/object:Gem::Version
130
130
  version: 0.10.0
131
131
  - !ruby/object:Gem::Dependency
132
- name: pry
133
132
  requirement: !ruby/object:Gem::Requirement
134
133
  requirements:
135
- - - "~>"
134
+ - - ~>
136
135
  - !ruby/object:Gem::Version
137
136
  version: 0.10.0
138
- type: :development
137
+ name: pry
139
138
  prerelease: false
139
+ type: :development
140
140
  version_requirements: !ruby/object:Gem::Requirement
141
141
  requirements:
142
- - - "~>"
142
+ - - ~>
143
143
  - !ruby/object:Gem::Version
144
144
  version: 0.10.0
145
145
  description: Lob API Ruby wrapper
@@ -149,8 +149,8 @@ executables: []
149
149
  extensions: []
150
150
  extra_rdoc_files: []
151
151
  files:
152
- - ".gitignore"
153
- - ".travis.yml"
152
+ - .gitignore
153
+ - .travis.yml
154
154
  - CHANGELOG.md
155
155
  - CONTRIBUTING.md
156
156
  - Gemfile
@@ -181,11 +181,13 @@ files:
181
181
  - lib/lob/resources/bank_account.rb
182
182
  - lib/lob/resources/check.rb
183
183
  - lib/lob/resources/country.rb
184
+ - lib/lob/resources/intl_verifications.rb
184
185
  - lib/lob/resources/letter.rb
185
186
  - lib/lob/resources/postcard.rb
186
187
  - lib/lob/resources/resource_base.rb
187
188
  - lib/lob/resources/route.rb
188
189
  - lib/lob/resources/state.rb
190
+ - lib/lob/resources/us_verifications.rb
189
191
  - lib/lob/version.rb
190
192
  - lob.gemspec
191
193
  - spec/lob/errors/lob_error_spec.rb
@@ -194,11 +196,13 @@ files:
194
196
  - spec/lob/resources/bank_account_spec.rb
195
197
  - spec/lob/resources/check_spec.rb
196
198
  - spec/lob/resources/country_spec.rb
199
+ - spec/lob/resources/intl_verifications_spec.rb
197
200
  - spec/lob/resources/letter_spec.rb
198
201
  - spec/lob/resources/postcard_spec.rb
199
202
  - spec/lob/resources/resource_base_spec.rb
200
203
  - spec/lob/resources/route_spec.rb
201
204
  - spec/lob/resources/state_spec.rb
205
+ - spec/lob/resources/us_verifications_spec.rb
202
206
  - spec/lob_spec.rb
203
207
  - spec/samples/8.5x11.pdf
204
208
  - spec/samples/postcardback.pdf
@@ -208,24 +212,24 @@ homepage: https://github.com/lob/lob-ruby
208
212
  licenses:
209
213
  - MIT
210
214
  metadata: {}
211
- post_install_message:
215
+ post_install_message:
212
216
  rdoc_options: []
213
217
  require_paths:
214
218
  - lib
215
219
  required_ruby_version: !ruby/object:Gem::Requirement
216
220
  requirements:
217
- - - ">="
221
+ - - '>='
218
222
  - !ruby/object:Gem::Version
219
223
  version: '0'
220
224
  required_rubygems_version: !ruby/object:Gem::Requirement
221
225
  requirements:
222
- - - ">="
226
+ - - '>='
223
227
  - !ruby/object:Gem::Version
224
228
  version: '0'
225
229
  requirements: []
226
- rubyforge_project:
227
- rubygems_version: 2.6.6
228
- signing_key:
230
+ rubyforge_project:
231
+ rubygems_version: 2.4.5
232
+ signing_key:
229
233
  specification_version: 4
230
234
  summary: Ruby wrapper for Lob.com API with ActiveRecord-style syntax
231
235
  test_files:
@@ -235,11 +239,13 @@ test_files:
235
239
  - spec/lob/resources/bank_account_spec.rb
236
240
  - spec/lob/resources/check_spec.rb
237
241
  - spec/lob/resources/country_spec.rb
242
+ - spec/lob/resources/intl_verifications_spec.rb
238
243
  - spec/lob/resources/letter_spec.rb
239
244
  - spec/lob/resources/postcard_spec.rb
240
245
  - spec/lob/resources/resource_base_spec.rb
241
246
  - spec/lob/resources/route_spec.rb
242
247
  - spec/lob/resources/state_spec.rb
248
+ - spec/lob/resources/us_verifications_spec.rb
243
249
  - spec/lob_spec.rb
244
250
  - spec/samples/8.5x11.pdf
245
251
  - spec/samples/postcardback.pdf