lob 5.2.0 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/README.md +2 -0
- data/lib/lob/client.rb +10 -0
- data/lib/lob/resources/bulk_intl_verifications.rb +26 -0
- data/lib/lob/resources/bulk_us_verifications.rb +27 -0
- data/lib/lob/version.rb +1 -1
- data/spec/lob/resources/bulk_intl_verifications_spec.rb +30 -0
- data/spec/lob/resources/bulk_us_verifications_spec.rb +37 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11eb162180fd2d34bf35f62e3b3e0abdb3319c55d126c0cde0b8653952bc3663
|
4
|
+
data.tar.gz: 7631ad45c98fdd77acaef477d2ce59f63adad41c4f765f9f738a42808f7d2ba6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ce91dceebe1903673e9b782c5af29012f06c7b8aea44d399b49d7efd06cc5975b336db6c369cea13cab0c160511606ecd85fefdff52fe5f9761bd04bd8e5730
|
7
|
+
data.tar.gz: 7cc830a0ac6fba54f81352c050b7baa2f732bb50146ac3dcedf5c9fc53b41dd2d1c4b3eed428639f254e25dfd77abd7aca67ae596986a236ff1d153073ad3d67
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
## [**5.3.0**](https://github.com/lob/lob-ruby/releases/tag/v5.3.0) (2021-08-25)
|
2
|
+
- [**190**](https://github.com/lob/lob-ruby/pull/190) Adds support for bulk AV endpoints
|
1
3
|
## [**5.2.0**](https://github.com/lob/lob-ruby/releases/tag/v5.2.0) (2021-05-03)
|
2
4
|
- [**188**](https://github.com/lob/lob-ruby/pull/188) Adds support for Self Mailers
|
3
5
|
## 5.1.2 (2021-02-18)
|
data/README.md
CHANGED
@@ -130,6 +130,7 @@ There are simple scripts to demonstrate how to create all the core Lob objects (
|
|
130
130
|
- [US Verification API](https://lob.com/docs/ruby#us_verifications)
|
131
131
|
- [The US Verification Object](https://lob.com/docs/ruby#us_verifications_object)
|
132
132
|
- [Verify a US Address](https://lob.com/docs/ruby#us_verifications_create)
|
133
|
+
- [Bulk Verify US Addresses](https://lob.com/docs/ruby#bulk_us_verifications_create)
|
133
134
|
- [The US Zip Lookup Object](https://lob.com/docs/ruby#us_zip_lookups_object)
|
134
135
|
- [Lookup a US Zip Code](https://lob.com/docs/ruby#us_zip_lookups_create)
|
135
136
|
- [US Autocompletion API](https://lob.com/docs/ruby#us_autocompletions)
|
@@ -139,6 +140,7 @@ There are simple scripts to demonstrate how to create all the core Lob objects (
|
|
139
140
|
- **Int'l Verification API**
|
140
141
|
- [International Verifications](https://lob.com/docs/ruby#intl_verifications)
|
141
142
|
- [Verify an International Address](https://lob.com/docs/ruby#intl_verifications_create)
|
143
|
+
- [Bulk Verify International Addresses](https://lob.com/docs/ruby#bulk_intl_verifications_create)
|
142
144
|
- **Postcards API**
|
143
145
|
- [Postcards](https://lob.com/docs/ruby#postcards)
|
144
146
|
- [The Postcard Object](https://lob.com/docs/ruby#postcards_object)
|
data/lib/lob/client.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
require "lob/resources/address"
|
2
2
|
require "lob/resources/bank_account"
|
3
|
+
require "lob/resources/bulk_intl_verifications"
|
4
|
+
require "lob/resources/bulk_us_verifications"
|
3
5
|
require "lob/resources/check"
|
4
6
|
require "lob/resources/group"
|
5
7
|
require "lob/resources/groups_member"
|
@@ -32,6 +34,14 @@ module Lob
|
|
32
34
|
Lob::Resources::BankAccount.new(config)
|
33
35
|
end
|
34
36
|
|
37
|
+
def bulk_intl_verifications
|
38
|
+
Lob::Resources::BulkIntlVerifications.new(config)
|
39
|
+
end
|
40
|
+
|
41
|
+
def bulk_us_verifications
|
42
|
+
Lob::Resources::BulkUSVerifications.new(config)
|
43
|
+
end
|
44
|
+
|
35
45
|
def checks
|
36
46
|
Lob::Resources::Check.new(config)
|
37
47
|
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require "lob/resources/resource_base"
|
2
|
+
|
3
|
+
module Lob
|
4
|
+
module Resources
|
5
|
+
class BulkIntlVerifications < Lob::Resources::ResourceBase
|
6
|
+
|
7
|
+
undef_method :list, :find, :create, :destroy
|
8
|
+
|
9
|
+
def initialize(config)
|
10
|
+
super(config)
|
11
|
+
@endpoint = "bulk/intl_verifications"
|
12
|
+
end
|
13
|
+
|
14
|
+
def verify(body={})
|
15
|
+
request = {
|
16
|
+
method: :post,
|
17
|
+
url: endpoint_url,
|
18
|
+
body: body
|
19
|
+
}
|
20
|
+
|
21
|
+
submit request
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require "lob/resources/resource_base"
|
2
|
+
|
3
|
+
module Lob
|
4
|
+
module Resources
|
5
|
+
class BulkUSVerifications < Lob::Resources::ResourceBase
|
6
|
+
|
7
|
+
undef_method :list, :find, :create, :destroy
|
8
|
+
|
9
|
+
def initialize(config)
|
10
|
+
super(config)
|
11
|
+
@endpoint = "bulk/us_verifications"
|
12
|
+
end
|
13
|
+
|
14
|
+
def verify(body={}, query={})
|
15
|
+
request = {
|
16
|
+
method: :post,
|
17
|
+
url: endpoint_url,
|
18
|
+
body: body,
|
19
|
+
query: query
|
20
|
+
}
|
21
|
+
|
22
|
+
submit request
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/lob/version.rb
CHANGED
@@ -0,0 +1,30 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Lob::Resources::BulkIntlVerifications do
|
4
|
+
|
5
|
+
before :each do
|
6
|
+
@sample_params = {
|
7
|
+
addresses: [
|
8
|
+
{
|
9
|
+
primary_line: "123 Test St",
|
10
|
+
city: "HEARST",
|
11
|
+
state: "ONTARIO",
|
12
|
+
postal_code: "P0L1N0",
|
13
|
+
country: "CA"
|
14
|
+
}
|
15
|
+
]
|
16
|
+
}
|
17
|
+
end
|
18
|
+
|
19
|
+
subject { Lob::Client.new(api_key: API_KEY) }
|
20
|
+
|
21
|
+
describe "verify" do
|
22
|
+
it "should verify an international address" do
|
23
|
+
result = subject.bulk_intl_verifications.verify @sample_params
|
24
|
+
addresses = result["addresses"]
|
25
|
+
address = addresses.first
|
26
|
+
address["recipient"].must_equal("TEST KEYS DO NOT VERIFY ADDRESSES")
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Lob::Resources::BulkUSVerifications do
|
4
|
+
|
5
|
+
before :each do
|
6
|
+
@sample_params = {
|
7
|
+
addresses: [
|
8
|
+
{
|
9
|
+
recipient: "LOB.COM",
|
10
|
+
primary_line: "185 BERRY ST STE 6600",
|
11
|
+
city: "SAN FRANCISCO",
|
12
|
+
state: "CA",
|
13
|
+
zip_code: "94107"
|
14
|
+
}
|
15
|
+
]
|
16
|
+
}
|
17
|
+
end
|
18
|
+
|
19
|
+
subject { Lob::Client.new(api_key: API_KEY) }
|
20
|
+
|
21
|
+
describe "verify" do
|
22
|
+
it "should verify a US address" do
|
23
|
+
result = subject.bulk_us_verifications.verify @sample_params
|
24
|
+
addresses = result["addresses"]
|
25
|
+
address = addresses.first
|
26
|
+
address["recipient"].must_equal("TEST KEYS DO NOT VERIFY ADDRESSES")
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should allow 'case' in query params" do
|
30
|
+
result = subject.bulk_us_verifications.verify @sample_params, {case: "proper"}
|
31
|
+
addresses = result["addresses"]
|
32
|
+
address = addresses.first
|
33
|
+
address["recipient"].must_equal("Test Keys Do Not Verify Addresses")
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lob
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lob
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -137,6 +137,8 @@ files:
|
|
137
137
|
- lib/lob/errors/lob_error.rb
|
138
138
|
- lib/lob/resources/address.rb
|
139
139
|
- lib/lob/resources/bank_account.rb
|
140
|
+
- lib/lob/resources/bulk_intl_verifications.rb
|
141
|
+
- lib/lob/resources/bulk_us_verifications.rb
|
140
142
|
- lib/lob/resources/check.rb
|
141
143
|
- lib/lob/resources/group.rb
|
142
144
|
- lib/lob/resources/groups_member.rb
|
@@ -153,6 +155,8 @@ files:
|
|
153
155
|
- spec/lob/errors/lob_error_spec.rb
|
154
156
|
- spec/lob/resources/address_spec.rb
|
155
157
|
- spec/lob/resources/bank_account_spec.rb
|
158
|
+
- spec/lob/resources/bulk_intl_verifications_spec.rb
|
159
|
+
- spec/lob/resources/bulk_us_verifications_spec.rb
|
156
160
|
- spec/lob/resources/check_spec.rb
|
157
161
|
- spec/lob/resources/group_spec.rb
|
158
162
|
- spec/lob/resources/intl_verifications_spec.rb
|
@@ -200,6 +204,8 @@ test_files:
|
|
200
204
|
- spec/lob/errors/lob_error_spec.rb
|
201
205
|
- spec/lob/resources/address_spec.rb
|
202
206
|
- spec/lob/resources/bank_account_spec.rb
|
207
|
+
- spec/lob/resources/bulk_intl_verifications_spec.rb
|
208
|
+
- spec/lob/resources/bulk_us_verifications_spec.rb
|
203
209
|
- spec/lob/resources/check_spec.rb
|
204
210
|
- spec/lob/resources/group_spec.rb
|
205
211
|
- spec/lob/resources/intl_verifications_spec.rb
|