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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1eddef68c4e49063f15b7f4634832a240c3a23cf
4
- data.tar.gz: 3edfed3dba4fddc7d7750921be0e7b96327712db
3
+ metadata.gz: 47d2c198be9a0a184ee2dce528a17019598aa1a8
4
+ data.tar.gz: 56d0ba7f17dc902a89409c7229c3de2a9f5859b2
5
5
  SHA512:
6
- metadata.gz: c7b161bf7195552d5ebccfa434404b091341374cc7cccc7da5d52c3d4b8fd64c197d5cdcb1768f7a00a05e00e21a7597005ac8df84e6b910ee28fa41538282f9
7
- data.tar.gz: 497354d79e8fb4be0ee802ee518461caab60b5562bb3f3b9f16fa6c8c9ead1c613e6d6099f772233a225d9af26a2acde6fcb0680f5cc0f3f83db368dadf653af
6
+ metadata.gz: 4c4acfe6abfa733ed7d417514303433006d3fa9719ca1ff190661e3d9f911e21e044ca536d4da0cb7a5807f629fb34994e31541a6c31bfc3a018b7c748a4bfdd
7
+ data.tar.gz: a84371070b0a83fbf9101a12803bc9e300c3aca145d7b432c16d63b5dcc1effb6219e8bdca9e21f454c09ad6b1aeb44bd409d4c17a2e83be374e719923478d33
@@ -1,11 +1,8 @@
1
1
  language: ruby
2
2
 
3
3
  rvm:
4
- - jruby-9.0.5.0
5
4
  - jruby-9.1.9.0
6
- - 2.1
7
- - 2.2
8
- - 2.3
5
+ - jruby-9.2.9.0
9
6
  - 2.4
10
7
  - 2.5
11
8
  - 2.6
@@ -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/services/postcards)
28
- - [Letters API](https://lob.com/services/letters)
29
- - [Checks API](https://lob.com/services/checks)
30
- - [Address Verification API](https://lob.com/services/verifications)
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
 
@@ -1,3 +1,3 @@
1
1
  module Lob
2
- VERSION = "5.1.0"
2
+ VERSION = "5.1.1"
3
3
  end
@@ -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.8", "< 3.0"
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.1"
27
- spec.add_development_dependency "simplecov", "~> 0.10.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 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
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.0
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: 2019-07-30 00:00:00.000000000 Z
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: '1.8'
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: '1.8'
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.1
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.1
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.10.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.10.0
102
+ version: 0.11.0
103
103
  description: Lob API Ruby wrapper
104
104
  email:
105
105
  - support@lob.com