lob 5.1.0 → 5.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -4
- data/CHANGELOG.md +10 -0
- data/README.md +4 -4
- data/lib/lob/resources/resource_base.rb +3 -0
- data/lib/lob/version.rb +1 -1
- data/lob.gemspec +3 -3
- data/spec/lob/resources/check_spec.rb +21 -0
- data/spec/lob/resources/intl_verifications_spec.rb +4 -7
- data/spec/lob/resources/letter_spec.rb +20 -0
- data/spec/lob/resources/postcard_spec.rb +25 -0
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47d2c198be9a0a184ee2dce528a17019598aa1a8
|
4
|
+
data.tar.gz: 56d0ba7f17dc902a89409c7229c3de2a9f5859b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c4acfe6abfa733ed7d417514303433006d3fa9719ca1ff190661e3d9f911e21e044ca536d4da0cb7a5807f629fb34994e31541a6c31bfc3a018b7c748a4bfdd
|
7
|
+
data.tar.gz: a84371070b0a83fbf9101a12803bc9e300c3aca145d7b432c16d63b5dcc1effb6219e8bdca9e21f454c09ad6b1aeb44bd409d4c17a2e83be374e719923478d33
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
#### 5.1.1 (2020-05-21)
|
2
|
+
|
3
|
+
##### Chores
|
4
|
+
|
5
|
+
* **intl-verification:** update international verifications test mode fix ([#179](https://github.com/lob/lob-ruby/pull/179)) ([4ab7e7e2](https://github.com/lob/lob-ruby/commit/4ab7e7e2852706c37b00bd8f2df58207897bc0a3))
|
6
|
+
|
7
|
+
##### Bug Fixes
|
8
|
+
|
9
|
+
* **merge-variables:** convert to json ([fa93885f](https://github.com/lob/lob-ruby/commit/fa93885f2aab4537e100b82d8a9f53cdec042f2e))
|
10
|
+
|
1
11
|
## [**5.1.0**](https://github.com/lob/lob-ruby/releases/tag/v5.1.0)
|
2
12
|
- [**176**](https://github.com/lob/lob-ruby/pull/176) Adds support for Group Members (beta feature)
|
3
13
|
- [**175**](https://github.com/lob/lob-ruby/pull/175) Adds support for Groups (beta feature)
|
data/README.md
CHANGED
@@ -24,10 +24,10 @@ Supports Ruby 2.0.0 and greater.
|
|
24
24
|
|
25
25
|
Here's a general overview of the Lob services available, click through to read more.
|
26
26
|
|
27
|
-
- [Postcards API](https://lob.com/
|
28
|
-
- [Letters API](https://lob.com/
|
29
|
-
- [Checks API](https://lob.com/
|
30
|
-
- [Address Verification API](https://lob.com/
|
27
|
+
- [Postcards API](https://lob.com/products/print-mail/postcards)
|
28
|
+
- [Letters API](https://lob.com/products/print-mail/letters)
|
29
|
+
- [Checks API](https://lob.com/products/print-mail/checks)
|
30
|
+
- [Address Verification API](https://lob.com/products/address-verification)
|
31
31
|
|
32
32
|
Please read through the official [API Documentation](#api-documentation) to get a complete sense of what to expect from each endpoint.
|
33
33
|
|
@@ -76,6 +76,9 @@ module Lob
|
|
76
76
|
if method == :get || method == :delete
|
77
77
|
response = RestClient.send(method, url, headers)
|
78
78
|
else
|
79
|
+
if body[:merge_variables] and body[:merge_variables].class == Hash
|
80
|
+
body[:merge_variables] = body[:merge_variables].to_json()
|
81
|
+
end
|
79
82
|
response = RestClient.send(method, url, body, headers)
|
80
83
|
end
|
81
84
|
|
data/lib/lob/version.rb
CHANGED
data/lob.gemspec
CHANGED
@@ -18,11 +18,11 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "rest-client", ">= 1
|
21
|
+
spec.add_dependency "rest-client", ">= 2.0.1", "< 3.0"
|
22
22
|
|
23
23
|
spec.add_development_dependency "rake", "~> 10.4.2"
|
24
24
|
spec.add_development_dependency "minitest", "~> 5.6.1"
|
25
25
|
spec.add_development_dependency "webmock", "~> 1.2"
|
26
|
-
spec.add_development_dependency "coveralls", "~> 0.8.
|
27
|
-
spec.add_development_dependency "simplecov", "~> 0.
|
26
|
+
spec.add_development_dependency "coveralls", "~> 0.8.13"
|
27
|
+
spec.add_development_dependency "simplecov", "~> 0.11.0"
|
28
28
|
end
|
@@ -50,6 +50,27 @@ describe Lob::Resources::Check do
|
|
50
50
|
|
51
51
|
result["amount"].to_s.must_equal("2000.12")
|
52
52
|
end
|
53
|
+
|
54
|
+
it "should create a check with a merge variable conditional" do
|
55
|
+
new_address = subject.addresses.create @sample_address_params
|
56
|
+
|
57
|
+
new_bank_account = subject.bank_accounts.create(@sample_bank_account_params)
|
58
|
+
|
59
|
+
subject.bank_accounts.verify(new_bank_account["id"], amounts: [1, 2])
|
60
|
+
|
61
|
+
result = subject.checks.create(
|
62
|
+
bank_account: new_bank_account["id"],
|
63
|
+
to: new_address["id"],
|
64
|
+
from: new_address["id"],
|
65
|
+
amount: "2000.12",
|
66
|
+
attachment: "<html>{{#is_awesome}}You are awesome!{{/is_awesome}}</html>",
|
67
|
+
merge_variables: {
|
68
|
+
is_awesome: false
|
69
|
+
}
|
70
|
+
)
|
71
|
+
|
72
|
+
result["merge_variables"]["is_awesome"].must_equal(false)
|
73
|
+
end
|
53
74
|
end
|
54
75
|
|
55
76
|
|
@@ -15,13 +15,10 @@ describe Lob::Resources::IntlVerifications do
|
|
15
15
|
subject { Lob::Client.new(api_key: API_KEY) }
|
16
16
|
|
17
17
|
describe "verify" do
|
18
|
-
it "should
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
assert e.http_status == 403
|
23
|
-
assert e._response.headers.include?(:content_type)
|
24
|
-
end
|
18
|
+
it "should verify an international address" do
|
19
|
+
result = subject.intl_verifications.verify @sample_params
|
20
|
+
|
21
|
+
result["recipient"].must_equal("TEST KEYS DO NOT VERIFY ADDRESSES")
|
25
22
|
end
|
26
23
|
end
|
27
24
|
|
@@ -52,6 +52,26 @@ describe Lob::Resources::Letter do
|
|
52
52
|
|
53
53
|
new_letter["description"].must_equal("TestLetter")
|
54
54
|
end
|
55
|
+
|
56
|
+
it "should create a letter with a merge variable object" do
|
57
|
+
new_address = subject.addresses.create @sample_address_params
|
58
|
+
|
59
|
+
new_letter = subject.letters.create(
|
60
|
+
description: "TestLetter",
|
61
|
+
color: true,
|
62
|
+
file: "<html>{{data.name}}</html>",
|
63
|
+
to: new_address["id"],
|
64
|
+
from: @sample_address_params,
|
65
|
+
merge_variables: {
|
66
|
+
data: {
|
67
|
+
name: "Kobe"
|
68
|
+
}
|
69
|
+
}
|
70
|
+
)
|
71
|
+
|
72
|
+
new_letter["description"].must_equal("TestLetter")
|
73
|
+
new_letter["merge_variables"]["data"]["name"].must_equal("Kobe")
|
74
|
+
end
|
55
75
|
end
|
56
76
|
|
57
77
|
|
@@ -95,6 +95,31 @@ describe Lob::Resources::Postcard do
|
|
95
95
|
result["description"].must_equal(@sample_postcard_params[:description])
|
96
96
|
end
|
97
97
|
|
98
|
+
it "should create a postcard with a merge variable list" do
|
99
|
+
new_address = subject.addresses.create @sample_address_params
|
100
|
+
merge_variables = {
|
101
|
+
list: [
|
102
|
+
{
|
103
|
+
name: "Larissa"
|
104
|
+
},
|
105
|
+
{
|
106
|
+
name: "Larry"
|
107
|
+
}
|
108
|
+
]
|
109
|
+
}
|
110
|
+
|
111
|
+
result = subject.postcards.create(
|
112
|
+
description: @sample_postcard_params[:description],
|
113
|
+
to: new_address["id"],
|
114
|
+
back: "<html>{{#list}} {{name}} {{/list}}</html>",
|
115
|
+
front: "https://lob.com/postcardfront.pdf",
|
116
|
+
merge_variables: merge_variables
|
117
|
+
)
|
118
|
+
|
119
|
+
result["description"].must_equal(@sample_postcard_params[:description])
|
120
|
+
result["merge_variables"]["list"][0]["name"].must_equal("Larissa")
|
121
|
+
result["merge_variables"]["list"][1]["name"].must_equal("Larry")
|
122
|
+
end
|
98
123
|
end
|
99
124
|
|
100
125
|
|
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.1.
|
4
|
+
version: 5.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lob
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.0.1
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: '3.0'
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 2.0.1
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '3.0'
|
@@ -78,28 +78,28 @@ dependencies:
|
|
78
78
|
requirements:
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: 0.8.
|
81
|
+
version: 0.8.13
|
82
82
|
type: :development
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version: 0.8.
|
88
|
+
version: 0.8.13
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: simplecov
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
93
|
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: 0.
|
95
|
+
version: 0.11.0
|
96
96
|
type: :development
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: 0.
|
102
|
+
version: 0.11.0
|
103
103
|
description: Lob API Ruby wrapper
|
104
104
|
email:
|
105
105
|
- support@lob.com
|