solidus_easypost 2.0.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +6 -0
- data/.github/stale.yml +4 -4
- data/.github_changelog_generator +2 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +3 -0
- data/.rubocop_todo.yml +12 -47
- data/CHANGELOG.md +113 -0
- data/LICENSE +1 -1
- data/README.md +111 -21
- data/app/controllers/spree/admin/postage_labels_controller.rb +20 -0
- data/app/decorators/models/solidus_easypost/spree/carton_decorator.rb +38 -0
- data/app/decorators/models/solidus_easypost/spree/shipment_decorator.rb +18 -23
- data/app/models/solidus_easypost/parcel_dimension.rb +34 -0
- data/app/models/solidus_easypost/return_authorization.rb +2 -13
- data/app/overrides/spree/admin/orders/_shipment/add_postage_label.html.erb.deface +10 -0
- data/bin/rails +0 -1
- data/bin/rails-engine +0 -2
- data/bin/rails-sandbox +1 -2
- data/bin/sandbox +2 -0
- data/config/initializers/webhooks.rb +7 -0
- data/config/locales/en.yml +7 -4
- data/config/routes.rb +5 -1
- data/db/migrate/20201025110912_add_tracker_id_to_cartons.rb +6 -0
- data/lib/generators/solidus_easypost/install/install_generator.rb +7 -1
- data/lib/generators/solidus_easypost/install/templates/initializer.rb +26 -0
- data/lib/solidus_easypost/address_builder.rb +45 -0
- data/lib/solidus_easypost/calculator/base_dimension_calculator.rb +28 -0
- data/lib/solidus_easypost/calculator/weight_dimension_calculator.rb +22 -0
- data/lib/solidus_easypost/configuration.rb +25 -2
- data/lib/solidus_easypost/errors/unknown_partial_resource_error.rb +11 -0
- data/lib/solidus_easypost/estimator.rb +37 -0
- data/lib/solidus_easypost/parcel_builder.rb +27 -0
- data/lib/solidus_easypost/shipment_builder.rb +32 -0
- data/lib/solidus_easypost/shipping_method_selector.rb +17 -0
- data/lib/solidus_easypost/shipping_rate_calculator.rb +9 -0
- data/lib/solidus_easypost/testing_support/factories/address_factory.rb +10 -0
- data/lib/solidus_easypost/testing_support/factories/product_factory.rb +7 -0
- data/lib/solidus_easypost/testing_support/factories/shipment_factory.rb +30 -0
- data/lib/solidus_easypost/testing_support/factories/shipping_method_factory.rb +8 -0
- data/lib/solidus_easypost/testing_support/factories/stock_location_factory.rb +10 -0
- data/lib/solidus_easypost/testing_support/factories/variant_factory.rb +7 -0
- data/lib/solidus_easypost/testing_support/factories.rb +3 -0
- data/lib/solidus_easypost/tracker_webhook_handler.rb +14 -0
- data/lib/solidus_easypost/version.rb +1 -1
- data/lib/solidus_easypost.rb +11 -0
- data/solidus_easypost.gemspec +8 -5
- data/spec/cassettes/{Spree_Address/_easypost_address/is_an_EasyPost_Address_object.yml → address_builder/from_address.yml} +19 -23
- data/spec/cassettes/{Spree_StockLocation/_easypost_address/is_an_EasyPost_Address_object.yml → address_builder/from_stock_location.yml} +19 -23
- data/spec/cassettes/{Spree_Stock_Estimator/_shipping_rates/when_rates_are_found/when_shipping_methods_exist/when_shipping_methods_are_front_end_visible/has_the_correct_costs.yml → estimator.yml} +0 -0
- data/spec/cassettes/integration/checkout.yml +377 -0
- data/spec/cassettes/integration/order_shipping/with_purchase_labels.yml +373 -0
- data/spec/cassettes/integration/order_shipping/without_purchase_labels.yml +251 -0
- data/spec/cassettes/{Spree_Stock_Package/_easypost_parcel/is_an_EasyPost_Parcel_object.yml → parcel_builder/from_package.yml} +17 -22
- data/spec/cassettes/{Spree_Stock_Package/_easypost_parcel/has_the_correct_attributes.yml → parcel_builder/from_return_authorization.yml} +17 -22
- data/spec/cassettes/postage_labels/show.yml +72 -0
- data/spec/cassettes/return_authorization.yml +310 -0
- data/spec/cassettes/{Spree_Stock_Package/_easypost_shipment/is_an_EasyPost_Shipment_object.yml → shipment_builder/from_package.yml} +74 -92
- data/spec/cassettes/{Spree_Stock_Estimator/_shipping_rates/when_rates_are_found/when_shipping_methods_exist/create_no_new_shipping_methods.yml → shipment_builder/from_return_authorization.yml} +77 -95
- data/spec/cassettes/shipment_builder/from_shipment.yml +250 -0
- data/spec/controllers/spree/admin/postage_labels_controller_spec.rb +18 -0
- data/spec/features/admin/postage_labels_spec.rb +18 -0
- data/spec/integration/checkout_spec.rb +45 -0
- data/spec/integration/order_shipping_spec.rb +33 -0
- data/spec/models/solidus_easypost/parcel_dimension_spec.rb +80 -0
- data/spec/models/solidus_easypost/return_authorization_spec.rb +7 -40
- data/spec/models/spree/carton_spec.rb +57 -0
- data/spec/models/spree/shipment_spec.rb +48 -59
- data/spec/models/spree/shipping_rate_spec.rb +14 -7
- data/spec/solidus_easypost/address_builder_spec.rb +17 -0
- data/spec/solidus_easypost/calculator/weight_dimension_calculator_spec.rb +39 -0
- data/spec/solidus_easypost/estimator_spec.rb +52 -0
- data/spec/solidus_easypost/parcel_builder_spec.rb +113 -0
- data/spec/solidus_easypost/shipment_builder_spec.rb +28 -0
- data/spec/solidus_easypost/shipping_method_selector_spec.rb +33 -0
- data/spec/solidus_easypost/shipping_rate_calculator_spec.rb +12 -0
- data/spec/solidus_easypost/tracker_webhook_handler_spec.rb +58 -0
- data/spec/spec_helper.rb +11 -7
- data/spec/support/easypost.rb +3 -1
- data/spec/support/helpers/api_stubs.rb +40 -0
- data/spec/support/helpers/configuration.rb +28 -0
- data/spec/support/helpers/shipping_methods.rb +26 -0
- data/spec/support/solidus.rb +1 -0
- data/spec/support/vcr.rb +1 -0
- metadata +118 -85
- data/app/decorators/models/solidus_easypost/spree/address_decorator.rb +0 -30
- data/app/decorators/models/solidus_easypost/spree/stock/estimator_decorator.rb +0 -15
- data/app/decorators/models/solidus_easypost/spree/stock/package_decorator.rb +0 -27
- data/app/decorators/models/solidus_easypost/spree/stock_location_decorator.rb +0 -26
- data/app/models/solidus_easypost/estimator.rb +0 -51
- data/lib/solidus_easypost/factories.rb +0 -24
- data/spec/cassettes/SolidusEasypost_ReturnAuthorization/_easypost_shipment/is_an_EasyPost_Shipment_object.yml +0 -271
- data/spec/cassettes/SolidusEasypost_ReturnAuthorization/_return_label/has_the_correct_fields.yml +0 -336
- data/spec/cassettes/SolidusEasypost_ReturnAuthorization/_return_label/is_an_EasyPost_PackageLabel_object.yml +0 -336
- data/spec/cassettes/Spree_Address/_easypost_address/has_the_correct_attributes.yml +0 -69
- data/spec/cassettes/Spree_Order/_refresh_shipment_rates/can_get_rates_from_easy_post.yml +0 -271
- data/spec/cassettes/Spree_Order/_refresh_shipment_rates/create_shipping_methods_for_the_rates.yml +0 -269
- data/spec/cassettes/Spree_Shipment/_buys_a_shipping_rate_after_transitioning_to_ship.yml +0 -403
- data/spec/cassettes/Spree_Shipment/_easypost_shipment/when_it_is_a_new_shipment/behaves_like_an_easypost_shipment/is_an_EasyPost_Shipment_object.yml +0 -271
- data/spec/cassettes/Spree_Shipment/_easypost_shipment/when_it_is_a_new_shipment/calls_the_api.yml +0 -200
- data/spec/cassettes/Spree_Shipment/_easypost_shipment/when_it_is_an_existing_shipment/behaves_like_an_easypost_shipment/is_an_EasyPost_Shipment_object.yml +0 -334
- data/spec/cassettes/Spree_Shipment/_easypost_shipment/when_it_is_an_existing_shipment/loads_the_existing_shipment.yml +0 -271
- data/spec/cassettes/Spree_StockLocation/_easypost_address/has_the_correct_attributes.yml +0 -69
- data/spec/cassettes/Spree_Stock_Estimator/_shipping_rates/when_rates_are_found/when_shipping_methods_dont_exist/creates_new_shipping_methods.yml +0 -269
- data/spec/cassettes/Spree_Stock_Estimator/_shipping_rates/when_rates_are_found/when_shipping_methods_dont_exist/is_empty.yml +0 -269
- data/spec/cassettes/Spree_Stock_Estimator/_shipping_rates/when_rates_are_found/when_shipping_methods_exist/when_shipping_methods_are_front_end_visible/has_the_correct_names.yml +0 -269
- data/spec/cassettes/Spree_Stock_Estimator/_shipping_rates/when_rates_are_found/when_shipping_methods_exist/when_shipping_methods_are_not_front_end_visible/is_empty.yml +0 -269
- data/spec/cassettes/Spree_Stock_Package/_easypost_shipment/calls_the_api.yml +0 -200
- data/spec/factories/spree_modification.rb +0 -25
- data/spec/models/spree/address_spec.rb +0 -31
- data/spec/models/spree/order_spec.rb +0 -31
- data/spec/models/spree/stock/estimator_spec.rb +0 -80
- data/spec/models/spree/stock/package_spec.rb +0 -35
- data/spec/models/spree/stock_location_spec.rb +0 -31
- data/spec/support/shipping_method_helpers.rb +0 -43
@@ -5,22 +5,19 @@ http_interactions:
|
|
5
5
|
uri: https://api.easypost.com/v2/addresses
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: address
|
8
|
+
string: '{"address":{"street1":"131 S 8th Ave","city":"Manville","zip":"08835","phone":"(202)
|
9
|
+
456-1111","name":"NY Warehouse","company":"NY Warehouse","state":"NJ","country":"US"}}'
|
9
10
|
headers:
|
11
|
+
Accept-Encoding:
|
12
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
10
13
|
Accept:
|
11
14
|
- "*/*"
|
12
15
|
User-Agent:
|
13
|
-
- EasyPost/v2 RubyClient/3.
|
14
|
-
Authorization:
|
15
|
-
- Bearer CvzYtuda6KRI9JjG7SAHbA
|
16
|
+
- EasyPost/v2 RubyClient/3.1.3 Ruby/2.7.1-p83
|
16
17
|
Content-Type:
|
17
|
-
- application/
|
18
|
-
|
19
|
-
-
|
20
|
-
Accept-Encoding:
|
21
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
22
|
-
Host:
|
23
|
-
- api.easypost.com
|
18
|
+
- application/json
|
19
|
+
Authorization:
|
20
|
+
- Basic Q3Z6WXR1ZGE2S1JJOUpqRzdTQUhiQTo=
|
24
21
|
response:
|
25
22
|
status:
|
26
23
|
code: 201
|
@@ -33,7 +30,7 @@ http_interactions:
|
|
33
30
|
X-Content-Type-Options:
|
34
31
|
- nosniff
|
35
32
|
X-Ep-Request-Uuid:
|
36
|
-
-
|
33
|
+
- 937dbd635f6b55deee812b080003fc20
|
37
34
|
Cache-Control:
|
38
35
|
- no-cache, no-store, must-revalidate, private
|
39
36
|
Pragma:
|
@@ -41,52 +38,48 @@ http_interactions:
|
|
41
38
|
Expires:
|
42
39
|
- '0'
|
43
40
|
Location:
|
44
|
-
- "/api/v2/addresses/
|
41
|
+
- "/api/v2/addresses/adr_78ab1c350ab541c099e8d7dca2a6d6f3"
|
45
42
|
Content-Type:
|
46
43
|
- application/json; charset=utf-8
|
47
44
|
X-Runtime:
|
48
|
-
- '0.
|
45
|
+
- '0.148401'
|
49
46
|
Transfer-Encoding:
|
50
47
|
- chunked
|
51
48
|
X-Node:
|
52
|
-
-
|
49
|
+
- bigweb2sj
|
53
50
|
X-Version-Label:
|
54
|
-
- easypost-
|
51
|
+
- easypost-202009222104-7ce76ac125-master
|
55
52
|
X-Backend:
|
56
53
|
- easypost
|
57
54
|
X-Proxied:
|
58
|
-
-
|
59
|
-
-
|
60
|
-
- intlb2wdc
|
55
|
+
- extlb1wdc a561deb64e
|
56
|
+
- intlb2sj 8df81f0396
|
57
|
+
- intlb2wdc 8df81f0396
|
61
58
|
Strict-Transport-Security:
|
62
59
|
- max-age=15768000; includeSubDomains; preload
|
63
60
|
body:
|
64
61
|
encoding: ASCII-8BIT
|
65
|
-
string: '{"id":"
|
66
|
-
|
67
|
-
|
68
|
-
recorded_at: Tue, 12 Nov 2019 08:37:09 GMT
|
62
|
+
string: '{"id":"adr_78ab1c350ab541c099e8d7dca2a6d6f3","object":"Address","created_at":"2020-09-23T14:04:14Z","updated_at":"2020-09-23T14:04:14Z","name":"NY
|
63
|
+
Warehouse","company":"NY Warehouse","street1":"131 S 8th Ave","street2":null,"city":"Manville","state":"NJ","zip":"08835","country":"US","phone":"2024561111","email":null,"mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":{}}'
|
64
|
+
recorded_at: Wed, 23 Sep 2020 14:04:14 GMT
|
69
65
|
- request:
|
70
66
|
method: post
|
71
67
|
uri: https://api.easypost.com/v2/addresses
|
72
68
|
body:
|
73
69
|
encoding: UTF-8
|
74
|
-
string: address
|
70
|
+
string: '{"address":{"street1":"A Different Road","street2":"Northwest","city":"Manville","zip":"08835","phone":"555-555-0199","company":"Company","name":"John
|
71
|
+
Doe","state":"NJ","country":"US"}}'
|
75
72
|
headers:
|
73
|
+
Accept-Encoding:
|
74
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
76
75
|
Accept:
|
77
76
|
- "*/*"
|
78
77
|
User-Agent:
|
79
|
-
- EasyPost/v2 RubyClient/3.
|
80
|
-
Authorization:
|
81
|
-
- Bearer CvzYtuda6KRI9JjG7SAHbA
|
78
|
+
- EasyPost/v2 RubyClient/3.1.3 Ruby/2.7.1-p83
|
82
79
|
Content-Type:
|
83
|
-
- application/
|
84
|
-
|
85
|
-
-
|
86
|
-
Accept-Encoding:
|
87
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
88
|
-
Host:
|
89
|
-
- api.easypost.com
|
80
|
+
- application/json
|
81
|
+
Authorization:
|
82
|
+
- Basic Q3Z6WXR1ZGE2S1JJOUpqRzdTQUhiQTo=
|
90
83
|
response:
|
91
84
|
status:
|
92
85
|
code: 201
|
@@ -99,7 +92,7 @@ http_interactions:
|
|
99
92
|
X-Content-Type-Options:
|
100
93
|
- nosniff
|
101
94
|
X-Ep-Request-Uuid:
|
102
|
-
-
|
95
|
+
- 937dbd635f6b55deee6f30ab0003fc49
|
103
96
|
Cache-Control:
|
104
97
|
- no-cache, no-store, must-revalidate, private
|
105
98
|
Pragma:
|
@@ -107,52 +100,47 @@ http_interactions:
|
|
107
100
|
Expires:
|
108
101
|
- '0'
|
109
102
|
Location:
|
110
|
-
- "/api/v2/addresses/
|
103
|
+
- "/api/v2/addresses/adr_079c8206e86f4163a1f6efa83cf5ee1e"
|
111
104
|
Content-Type:
|
112
105
|
- application/json; charset=utf-8
|
113
106
|
X-Runtime:
|
114
|
-
- '0.
|
107
|
+
- '0.052933'
|
115
108
|
Transfer-Encoding:
|
116
109
|
- chunked
|
117
110
|
X-Node:
|
118
|
-
-
|
111
|
+
- bigweb9sj
|
119
112
|
X-Version-Label:
|
120
|
-
- easypost-
|
113
|
+
- easypost-202009222104-7ce76ac125-master
|
121
114
|
X-Backend:
|
122
115
|
- easypost
|
123
116
|
X-Proxied:
|
124
|
-
-
|
125
|
-
- intlb1sj
|
126
|
-
-
|
117
|
+
- extlb1wdc a561deb64e
|
118
|
+
- intlb1sj 8df81f0396
|
119
|
+
- intlb2wdc 8df81f0396
|
127
120
|
Strict-Transport-Security:
|
128
121
|
- max-age=15768000; includeSubDomains; preload
|
129
122
|
body:
|
130
123
|
encoding: ASCII-8BIT
|
131
|
-
string: '{"id":"
|
132
|
-
|
133
|
-
|
134
|
-
recorded_at: Tue, 12 Nov 2019 08:37:10 GMT
|
124
|
+
string: '{"id":"adr_079c8206e86f4163a1f6efa83cf5ee1e","object":"Address","created_at":"2020-09-23T14:04:15Z","updated_at":"2020-09-23T14:04:15Z","name":"John
|
125
|
+
Doe","company":"Company","street1":"A Different Road","street2":"Northwest","city":"Manville","state":"NJ","zip":"08835","country":"US","phone":"5555550199","email":null,"mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":{}}'
|
126
|
+
recorded_at: Wed, 23 Sep 2020 14:04:15 GMT
|
135
127
|
- request:
|
136
128
|
method: post
|
137
129
|
uri: https://api.easypost.com/v2/parcels
|
138
130
|
body:
|
139
131
|
encoding: UTF-8
|
140
|
-
string: parcel
|
132
|
+
string: '{"parcel":{"weight":10}}'
|
141
133
|
headers:
|
134
|
+
Accept-Encoding:
|
135
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
142
136
|
Accept:
|
143
137
|
- "*/*"
|
144
138
|
User-Agent:
|
145
|
-
- EasyPost/v2 RubyClient/3.
|
146
|
-
Authorization:
|
147
|
-
- Bearer CvzYtuda6KRI9JjG7SAHbA
|
139
|
+
- EasyPost/v2 RubyClient/3.1.3 Ruby/2.7.1-p83
|
148
140
|
Content-Type:
|
149
|
-
- application/
|
150
|
-
|
151
|
-
-
|
152
|
-
Accept-Encoding:
|
153
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
154
|
-
Host:
|
155
|
-
- api.easypost.com
|
141
|
+
- application/json
|
142
|
+
Authorization:
|
143
|
+
- Basic Q3Z6WXR1ZGE2S1JJOUpqRzdTQUhiQTo=
|
156
144
|
response:
|
157
145
|
status:
|
158
146
|
code: 201
|
@@ -165,7 +153,7 @@ http_interactions:
|
|
165
153
|
X-Content-Type-Options:
|
166
154
|
- nosniff
|
167
155
|
X-Ep-Request-Uuid:
|
168
|
-
-
|
156
|
+
- 937dbd625f6b55dfee6f1f050003fc7e
|
169
157
|
Cache-Control:
|
170
158
|
- no-cache, no-store, must-revalidate, private
|
171
159
|
Pragma:
|
@@ -173,51 +161,46 @@ http_interactions:
|
|
173
161
|
Expires:
|
174
162
|
- '0'
|
175
163
|
Location:
|
176
|
-
- "/api/v2/parcels/
|
164
|
+
- "/api/v2/parcels/prcl_da01bd8f5d924d17a96da73bcacaa247"
|
177
165
|
Content-Type:
|
178
166
|
- application/json; charset=utf-8
|
179
167
|
X-Runtime:
|
180
|
-
- '0.
|
168
|
+
- '0.032663'
|
181
169
|
Transfer-Encoding:
|
182
170
|
- chunked
|
183
171
|
X-Node:
|
184
|
-
-
|
172
|
+
- bigweb9sj
|
185
173
|
X-Version-Label:
|
186
|
-
- easypost-
|
174
|
+
- easypost-202009222104-7ce76ac125-master
|
187
175
|
X-Backend:
|
188
176
|
- easypost
|
189
177
|
X-Proxied:
|
190
|
-
-
|
191
|
-
-
|
192
|
-
- intlb2wdc
|
178
|
+
- extlb1wdc a561deb64e
|
179
|
+
- intlb1sj 8df81f0396
|
180
|
+
- intlb2wdc 8df81f0396
|
193
181
|
Strict-Transport-Security:
|
194
182
|
- max-age=15768000; includeSubDomains; preload
|
195
183
|
body:
|
196
184
|
encoding: ASCII-8BIT
|
197
|
-
string: '{"id":"
|
198
|
-
|
199
|
-
recorded_at: Tue, 12 Nov 2019 08:37:11 GMT
|
185
|
+
string: '{"id":"prcl_da01bd8f5d924d17a96da73bcacaa247","object":"Parcel","created_at":"2020-09-23T14:04:15Z","updated_at":"2020-09-23T14:04:15Z","length":null,"width":null,"height":null,"predefined_package":null,"weight":10.0,"mode":"test"}'
|
186
|
+
recorded_at: Wed, 23 Sep 2020 14:04:15 GMT
|
200
187
|
- request:
|
201
188
|
method: post
|
202
189
|
uri: https://api.easypost.com/v2/shipments
|
203
190
|
body:
|
204
191
|
encoding: UTF-8
|
205
|
-
string: shipment
|
192
|
+
string: '{"shipment":{"from_address":{"id":"adr_78ab1c350ab541c099e8d7dca2a6d6f3"},"to_address":{"id":"adr_079c8206e86f4163a1f6efa83cf5ee1e"},"parcel":{"id":"prcl_da01bd8f5d924d17a96da73bcacaa247"},"is_return":true}}'
|
206
193
|
headers:
|
194
|
+
Accept-Encoding:
|
195
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
207
196
|
Accept:
|
208
197
|
- "*/*"
|
209
198
|
User-Agent:
|
210
|
-
- EasyPost/v2 RubyClient/3.
|
211
|
-
Authorization:
|
212
|
-
- Bearer CvzYtuda6KRI9JjG7SAHbA
|
199
|
+
- EasyPost/v2 RubyClient/3.1.3 Ruby/2.7.1-p83
|
213
200
|
Content-Type:
|
214
|
-
- application/
|
215
|
-
|
216
|
-
-
|
217
|
-
Accept-Encoding:
|
218
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
219
|
-
Host:
|
220
|
-
- api.easypost.com
|
201
|
+
- application/json
|
202
|
+
Authorization:
|
203
|
+
- Basic Q3Z6WXR1ZGE2S1JJOUpqRzdTQUhiQTo=
|
221
204
|
response:
|
222
205
|
status:
|
223
206
|
code: 201
|
@@ -230,7 +213,7 @@ http_interactions:
|
|
230
213
|
X-Content-Type-Options:
|
231
214
|
- nosniff
|
232
215
|
X-Ep-Request-Uuid:
|
233
|
-
-
|
216
|
+
- 937dbd625f6b55e0ee715dad0003fcb0
|
234
217
|
Cache-Control:
|
235
218
|
- no-cache, no-store, must-revalidate, private
|
236
219
|
Pragma:
|
@@ -238,32 +221,31 @@ http_interactions:
|
|
238
221
|
Expires:
|
239
222
|
- '0'
|
240
223
|
Location:
|
241
|
-
- "/api/v2/shipments/
|
224
|
+
- "/api/v2/shipments/shp_d05f260d382d48cea1e62472d169eb59"
|
242
225
|
Content-Type:
|
243
226
|
- application/json; charset=utf-8
|
244
227
|
X-Runtime:
|
245
|
-
- '0.
|
228
|
+
- '0.184911'
|
246
229
|
Transfer-Encoding:
|
247
230
|
- chunked
|
248
231
|
X-Node:
|
249
|
-
-
|
232
|
+
- bigweb12sj
|
250
233
|
X-Version-Label:
|
251
|
-
- easypost-
|
234
|
+
- easypost-202009222104-7ce76ac125-master
|
252
235
|
X-Backend:
|
253
236
|
- easypost
|
254
237
|
X-Proxied:
|
255
|
-
-
|
256
|
-
-
|
257
|
-
-
|
238
|
+
- extlb1wdc a561deb64e
|
239
|
+
- intlb1wdc 8df81f0396
|
240
|
+
- intlb2sj 8df81f0396
|
258
241
|
Strict-Transport-Security:
|
259
242
|
- max-age=15768000; includeSubDomains; preload
|
260
243
|
body:
|
261
244
|
encoding: ASCII-8BIT
|
262
|
-
string: '{"created_at":"
|
263
|
-
Warehouse","company":"NY Warehouse","street1":"131 S 8th Ave","street2":null,"city":"Manville","state":"NJ","zip":"08835","country":"US","phone":"2024561111","email":null,"mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":{}},"insurance":null,"order_id":null,"parcel":{"id":"
|
264
|
-
Doe","company":"Company","street1":"A Different Road","street2":"Northwest","city":"Manville","state":"NJ","zip":"08835","country":"US","phone":"5555550199","email":null,"mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":{}},"usps_zone":1,"return_address":{"id":"
|
265
|
-
Warehouse","company":"NY Warehouse","street1":"131 S 8th Ave","street2":null,"city":"Manville","state":"NJ","zip":"08835","country":"US","phone":"2024561111","email":null,"mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":{}},"buyer_address":{"id":"
|
266
|
-
Doe","company":"Company","street1":"A Different Road","street2":"Northwest","city":"Manville","state":"NJ","zip":"08835","country":"US","phone":"5555550199","email":null,"mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":{}},"forms":[],"fees":[],"id":"
|
267
|
-
|
268
|
-
|
269
|
-
recorded_with: VCR 5.0.0
|
245
|
+
string: '{"created_at":"2020-09-23T14:04:16Z","is_return":true,"messages":[],"mode":"test","options":{"currency":"USD","payment":{"type":"SENDER"},"date_advance":0},"reference":null,"status":"unknown","tracking_code":null,"updated_at":"2020-09-23T14:04:16Z","batch_id":null,"batch_status":null,"batch_message":null,"customs_info":null,"from_address":{"id":"adr_78ab1c350ab541c099e8d7dca2a6d6f3","object":"Address","created_at":"2020-09-23T14:04:14Z","updated_at":"2020-09-23T14:04:14Z","name":"NY
|
246
|
+
Warehouse","company":"NY Warehouse","street1":"131 S 8th Ave","street2":null,"city":"Manville","state":"NJ","zip":"08835","country":"US","phone":"2024561111","email":null,"mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":{}},"insurance":null,"order_id":null,"parcel":{"id":"prcl_da01bd8f5d924d17a96da73bcacaa247","object":"Parcel","created_at":"2020-09-23T14:04:15Z","updated_at":"2020-09-23T14:04:15Z","length":null,"width":null,"height":null,"predefined_package":null,"weight":10.0,"mode":"test"},"postage_label":null,"rates":[{"id":"rate_d39c45d3b89b4cf8acd313ef13507eb4","object":"Rate","created_at":"2020-09-23T14:04:16Z","updated_at":"2020-09-23T14:04:16Z","mode":"test","service":"Express","carrier":"USPS","rate":"23.00","currency":"USD","retail_rate":"26.75","retail_currency":"USD","list_rate":"23.00","list_currency":"USD","delivery_days":null,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":null,"shipment_id":"shp_d05f260d382d48cea1e62472d169eb59","carrier_account_id":"ca_mtb51Ve0"},{"id":"rate_cfa4646b92844d01b9af3e1aa1da4afd","object":"Rate","created_at":"2020-09-23T14:04:16Z","updated_at":"2020-09-23T14:04:16Z","mode":"test","service":"Priority","carrier":"USPS","rate":"7.02","currency":"USD","retail_rate":"7.50","retail_currency":"USD","list_rate":"7.02","list_currency":"USD","delivery_days":1,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":1,"shipment_id":"shp_d05f260d382d48cea1e62472d169eb59","carrier_account_id":"ca_mtb51Ve0"},{"id":"rate_c0558049b08b4ac68b0affe87e937356","object":"Rate","created_at":"2020-09-23T14:04:16Z","updated_at":"2020-09-23T14:04:16Z","mode":"test","service":"First","carrier":"USPS","rate":"3.93","currency":"USD","retail_rate":"5.30","retail_currency":"USD","list_rate":"3.93","list_currency":"USD","delivery_days":2,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":2,"shipment_id":"shp_d05f260d382d48cea1e62472d169eb59","carrier_account_id":"ca_mtb51Ve0"},{"id":"rate_b8f4316d65624742bfe244e104ed6d0f","object":"Rate","created_at":"2020-09-23T14:04:16Z","updated_at":"2020-09-23T14:04:16Z","mode":"test","service":"ParcelSelect","carrier":"USPS","rate":"6.92","currency":"USD","retail_rate":"6.92","retail_currency":"USD","list_rate":"6.92","list_currency":"USD","delivery_days":2,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":2,"shipment_id":"shp_d05f260d382d48cea1e62472d169eb59","carrier_account_id":"ca_mtb51Ve0"}],"refund_status":null,"scan_form":null,"selected_rate":null,"tracker":null,"to_address":{"id":"adr_079c8206e86f4163a1f6efa83cf5ee1e","object":"Address","created_at":"2020-09-23T14:04:15Z","updated_at":"2020-09-23T14:04:15Z","name":"John
|
247
|
+
Doe","company":"Company","street1":"A Different Road","street2":"Northwest","city":"Manville","state":"NJ","zip":"08835","country":"US","phone":"5555550199","email":null,"mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":{}},"usps_zone":1,"return_address":{"id":"adr_78ab1c350ab541c099e8d7dca2a6d6f3","object":"Address","created_at":"2020-09-23T14:04:14Z","updated_at":"2020-09-23T14:04:14Z","name":"NY
|
248
|
+
Warehouse","company":"NY Warehouse","street1":"131 S 8th Ave","street2":null,"city":"Manville","state":"NJ","zip":"08835","country":"US","phone":"2024561111","email":null,"mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":{}},"buyer_address":{"id":"adr_079c8206e86f4163a1f6efa83cf5ee1e","object":"Address","created_at":"2020-09-23T14:04:15Z","updated_at":"2020-09-23T14:04:15Z","name":"John
|
249
|
+
Doe","company":"Company","street1":"A Different Road","street2":"Northwest","city":"Manville","state":"NJ","zip":"08835","country":"US","phone":"5555550199","email":null,"mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":{}},"forms":[],"fees":[],"id":"shp_d05f260d382d48cea1e62472d169eb59","object":"Shipment"}'
|
250
|
+
recorded_at: Wed, 23 Sep 2020 14:04:16 GMT
|
251
|
+
recorded_with: VCR 6.0.0
|
@@ -0,0 +1,250 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.easypost.com/v2/addresses
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"address":{"street1":"A Different Road","street2":"Northwest","city":"Manville","zip":"08835","phone":"555-555-0199","company":"Company","name":"John
|
9
|
+
Doe","state":"NJ","country":"US"}}'
|
10
|
+
headers:
|
11
|
+
Accept-Encoding:
|
12
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
13
|
+
Accept:
|
14
|
+
- "*/*"
|
15
|
+
User-Agent:
|
16
|
+
- EasyPost/v2 RubyClient/3.1.3 Ruby/2.7.1-p83
|
17
|
+
Content-Type:
|
18
|
+
- application/json
|
19
|
+
Authorization:
|
20
|
+
- Basic Q3Z6WXR1ZGE2S1JJOUpqRzdTQUhiQTo=
|
21
|
+
response:
|
22
|
+
status:
|
23
|
+
code: 201
|
24
|
+
message: Created
|
25
|
+
headers:
|
26
|
+
X-Frame-Options:
|
27
|
+
- SAMEORIGIN
|
28
|
+
X-Xss-Protection:
|
29
|
+
- 1; mode=block
|
30
|
+
X-Content-Type-Options:
|
31
|
+
- nosniff
|
32
|
+
X-Ep-Request-Uuid:
|
33
|
+
- a371cbc25f6b5571ee6faf850003c17b
|
34
|
+
Cache-Control:
|
35
|
+
- no-cache, no-store, must-revalidate, private
|
36
|
+
Pragma:
|
37
|
+
- no-cache
|
38
|
+
Expires:
|
39
|
+
- '0'
|
40
|
+
Location:
|
41
|
+
- "/api/v2/addresses/adr_09b102bdfe394d3fb4e3244e8a39fa13"
|
42
|
+
Content-Type:
|
43
|
+
- application/json; charset=utf-8
|
44
|
+
X-Runtime:
|
45
|
+
- '0.055226'
|
46
|
+
Transfer-Encoding:
|
47
|
+
- chunked
|
48
|
+
X-Node:
|
49
|
+
- bigweb7sj
|
50
|
+
X-Version-Label:
|
51
|
+
- easypost-202009222104-7ce76ac125-master
|
52
|
+
X-Backend:
|
53
|
+
- easypost
|
54
|
+
X-Canary:
|
55
|
+
- direct
|
56
|
+
X-Proxied:
|
57
|
+
- extlb2wdc a561deb64e
|
58
|
+
- intlb1sj 8df81f0396
|
59
|
+
- intlb2wdc 8df81f0396
|
60
|
+
Strict-Transport-Security:
|
61
|
+
- max-age=15768000; includeSubDomains; preload
|
62
|
+
body:
|
63
|
+
encoding: ASCII-8BIT
|
64
|
+
string: '{"id":"adr_09b102bdfe394d3fb4e3244e8a39fa13","object":"Address","created_at":"2020-09-23T14:02:25Z","updated_at":"2020-09-23T14:02:25Z","name":"John
|
65
|
+
Doe","company":"Company","street1":"A Different Road","street2":"Northwest","city":"Manville","state":"NJ","zip":"08835","country":"US","phone":"5555550199","email":null,"mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":{}}'
|
66
|
+
recorded_at: Wed, 23 Sep 2020 14:02:25 GMT
|
67
|
+
- request:
|
68
|
+
method: post
|
69
|
+
uri: https://api.easypost.com/v2/addresses
|
70
|
+
body:
|
71
|
+
encoding: UTF-8
|
72
|
+
string: '{"address":{"street1":"131 S 8th Ave","city":"Manville","zip":"08835","phone":"(202)
|
73
|
+
456-1111","name":"NY Warehouse","company":"NY Warehouse","state":"NJ","country":"US"}}'
|
74
|
+
headers:
|
75
|
+
Accept-Encoding:
|
76
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
77
|
+
Accept:
|
78
|
+
- "*/*"
|
79
|
+
User-Agent:
|
80
|
+
- EasyPost/v2 RubyClient/3.1.3 Ruby/2.7.1-p83
|
81
|
+
Content-Type:
|
82
|
+
- application/json
|
83
|
+
Authorization:
|
84
|
+
- Basic Q3Z6WXR1ZGE2S1JJOUpqRzdTQUhiQTo=
|
85
|
+
response:
|
86
|
+
status:
|
87
|
+
code: 201
|
88
|
+
message: Created
|
89
|
+
headers:
|
90
|
+
X-Frame-Options:
|
91
|
+
- SAMEORIGIN
|
92
|
+
X-Xss-Protection:
|
93
|
+
- 1; mode=block
|
94
|
+
X-Content-Type-Options:
|
95
|
+
- nosniff
|
96
|
+
X-Ep-Request-Uuid:
|
97
|
+
- 3682484c5f6b5571ee7048a900032e90
|
98
|
+
Cache-Control:
|
99
|
+
- no-cache, no-store, must-revalidate, private
|
100
|
+
Pragma:
|
101
|
+
- no-cache
|
102
|
+
Expires:
|
103
|
+
- '0'
|
104
|
+
Location:
|
105
|
+
- "/api/v2/addresses/adr_6f05641e3fa94ffaab66b4c1c9b18aa2"
|
106
|
+
Content-Type:
|
107
|
+
- application/json; charset=utf-8
|
108
|
+
X-Runtime:
|
109
|
+
- '0.050116'
|
110
|
+
Transfer-Encoding:
|
111
|
+
- chunked
|
112
|
+
X-Node:
|
113
|
+
- bigweb2sj
|
114
|
+
X-Version-Label:
|
115
|
+
- easypost-202009222104-7ce76ac125-master
|
116
|
+
X-Backend:
|
117
|
+
- easypost
|
118
|
+
X-Proxied:
|
119
|
+
- extlb2sj a561deb64e
|
120
|
+
- intlb1sj 8df81f0396
|
121
|
+
Strict-Transport-Security:
|
122
|
+
- max-age=15768000; includeSubDomains; preload
|
123
|
+
body:
|
124
|
+
encoding: ASCII-8BIT
|
125
|
+
string: '{"id":"adr_6f05641e3fa94ffaab66b4c1c9b18aa2","object":"Address","created_at":"2020-09-23T14:02:26Z","updated_at":"2020-09-23T14:02:26Z","name":"NY
|
126
|
+
Warehouse","company":"NY Warehouse","street1":"131 S 8th Ave","street2":null,"city":"Manville","state":"NJ","zip":"08835","country":"US","phone":"2024561111","email":null,"mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":{}}'
|
127
|
+
recorded_at: Wed, 23 Sep 2020 14:02:26 GMT
|
128
|
+
- request:
|
129
|
+
method: post
|
130
|
+
uri: https://api.easypost.com/v2/parcels
|
131
|
+
body:
|
132
|
+
encoding: UTF-8
|
133
|
+
string: '{"parcel":{"weight":"10.0"}}'
|
134
|
+
headers:
|
135
|
+
Accept-Encoding:
|
136
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
137
|
+
Accept:
|
138
|
+
- "*/*"
|
139
|
+
User-Agent:
|
140
|
+
- EasyPost/v2 RubyClient/3.1.3 Ruby/2.7.1-p83
|
141
|
+
Content-Type:
|
142
|
+
- application/json
|
143
|
+
Authorization:
|
144
|
+
- Basic Q3Z6WXR1ZGE2S1JJOUpqRzdTQUhiQTo=
|
145
|
+
response:
|
146
|
+
status:
|
147
|
+
code: 201
|
148
|
+
message: Created
|
149
|
+
headers:
|
150
|
+
X-Frame-Options:
|
151
|
+
- SAMEORIGIN
|
152
|
+
X-Xss-Protection:
|
153
|
+
- 1; mode=block
|
154
|
+
X-Content-Type-Options:
|
155
|
+
- nosniff
|
156
|
+
X-Ep-Request-Uuid:
|
157
|
+
- 3682484f5f6b5572ee726a1100032ebc
|
158
|
+
Cache-Control:
|
159
|
+
- no-cache, no-store, must-revalidate, private
|
160
|
+
Pragma:
|
161
|
+
- no-cache
|
162
|
+
Expires:
|
163
|
+
- '0'
|
164
|
+
Location:
|
165
|
+
- "/api/v2/parcels/prcl_3090e16064144a11bf83d2c91b4cc351"
|
166
|
+
Content-Type:
|
167
|
+
- application/json; charset=utf-8
|
168
|
+
X-Runtime:
|
169
|
+
- '0.038919'
|
170
|
+
Transfer-Encoding:
|
171
|
+
- chunked
|
172
|
+
X-Node:
|
173
|
+
- bigweb4sj
|
174
|
+
X-Version-Label:
|
175
|
+
- easypost-202009222104-7ce76ac125-master
|
176
|
+
X-Backend:
|
177
|
+
- easypost
|
178
|
+
X-Proxied:
|
179
|
+
- extlb2sj a561deb64e
|
180
|
+
- intlb2sj 8df81f0396
|
181
|
+
Strict-Transport-Security:
|
182
|
+
- max-age=15768000; includeSubDomains; preload
|
183
|
+
body:
|
184
|
+
encoding: ASCII-8BIT
|
185
|
+
string: '{"id":"prcl_3090e16064144a11bf83d2c91b4cc351","object":"Parcel","created_at":"2020-09-23T14:02:26Z","updated_at":"2020-09-23T14:02:26Z","length":null,"width":null,"height":null,"predefined_package":null,"weight":10.0,"mode":"test"}'
|
186
|
+
recorded_at: Wed, 23 Sep 2020 14:02:26 GMT
|
187
|
+
- request:
|
188
|
+
method: post
|
189
|
+
uri: https://api.easypost.com/v2/shipments
|
190
|
+
body:
|
191
|
+
encoding: UTF-8
|
192
|
+
string: '{"shipment":{"to_address":{"id":"adr_09b102bdfe394d3fb4e3244e8a39fa13"},"from_address":{"id":"adr_6f05641e3fa94ffaab66b4c1c9b18aa2"},"parcel":{"id":"prcl_3090e16064144a11bf83d2c91b4cc351"}}}'
|
193
|
+
headers:
|
194
|
+
Accept-Encoding:
|
195
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
196
|
+
Accept:
|
197
|
+
- "*/*"
|
198
|
+
User-Agent:
|
199
|
+
- EasyPost/v2 RubyClient/3.1.3 Ruby/2.7.1-p83
|
200
|
+
Content-Type:
|
201
|
+
- application/json
|
202
|
+
Authorization:
|
203
|
+
- Basic Q3Z6WXR1ZGE2S1JJOUpqRzdTQUhiQTo=
|
204
|
+
response:
|
205
|
+
status:
|
206
|
+
code: 201
|
207
|
+
message: Created
|
208
|
+
headers:
|
209
|
+
X-Frame-Options:
|
210
|
+
- SAMEORIGIN
|
211
|
+
X-Xss-Protection:
|
212
|
+
- 1; mode=block
|
213
|
+
X-Content-Type-Options:
|
214
|
+
- nosniff
|
215
|
+
X-Ep-Request-Uuid:
|
216
|
+
- 4c4cd68c5f6b5573ee726d6c000339ec
|
217
|
+
Cache-Control:
|
218
|
+
- no-cache, no-store, must-revalidate, private
|
219
|
+
Pragma:
|
220
|
+
- no-cache
|
221
|
+
Expires:
|
222
|
+
- '0'
|
223
|
+
Location:
|
224
|
+
- "/api/v2/shipments/shp_5bbe2086eb634ce08bf7c0bebebc4874"
|
225
|
+
Content-Type:
|
226
|
+
- application/json; charset=utf-8
|
227
|
+
X-Runtime:
|
228
|
+
- '0.197844'
|
229
|
+
Transfer-Encoding:
|
230
|
+
- chunked
|
231
|
+
X-Node:
|
232
|
+
- bigweb12sj
|
233
|
+
X-Version-Label:
|
234
|
+
- easypost-202009222104-7ce76ac125-master
|
235
|
+
X-Backend:
|
236
|
+
- easypost
|
237
|
+
X-Proxied:
|
238
|
+
- extlb1sj a561deb64e
|
239
|
+
- intlb1sj 8df81f0396
|
240
|
+
Strict-Transport-Security:
|
241
|
+
- max-age=15768000; includeSubDomains; preload
|
242
|
+
body:
|
243
|
+
encoding: ASCII-8BIT
|
244
|
+
string: '{"created_at":"2020-09-23T14:02:27Z","is_return":false,"messages":[],"mode":"test","options":{"currency":"USD","payment":{"type":"SENDER"},"date_advance":0},"reference":null,"status":"unknown","tracking_code":null,"updated_at":"2020-09-23T14:02:27Z","batch_id":null,"batch_status":null,"batch_message":null,"customs_info":null,"from_address":{"id":"adr_6f05641e3fa94ffaab66b4c1c9b18aa2","object":"Address","created_at":"2020-09-23T14:02:26Z","updated_at":"2020-09-23T14:02:26Z","name":"NY
|
245
|
+
Warehouse","company":"NY Warehouse","street1":"131 S 8th Ave","street2":null,"city":"Manville","state":"NJ","zip":"08835","country":"US","phone":"2024561111","email":null,"mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":{}},"insurance":null,"order_id":null,"parcel":{"id":"prcl_3090e16064144a11bf83d2c91b4cc351","object":"Parcel","created_at":"2020-09-23T14:02:26Z","updated_at":"2020-09-23T14:02:26Z","length":null,"width":null,"height":null,"predefined_package":null,"weight":10.0,"mode":"test"},"postage_label":null,"rates":[{"id":"rate_37bb9c4b39044d119488f92f062dae0a","object":"Rate","created_at":"2020-09-23T14:02:27Z","updated_at":"2020-09-23T14:02:27Z","mode":"test","service":"Priority","carrier":"USPS","rate":"7.02","currency":"USD","retail_rate":"7.50","retail_currency":"USD","list_rate":"7.02","list_currency":"USD","delivery_days":1,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":1,"shipment_id":"shp_5bbe2086eb634ce08bf7c0bebebc4874","carrier_account_id":"ca_mtb51Ve0"},{"id":"rate_52b1e4a47f4b4f279be7f40b900bc343","object":"Rate","created_at":"2020-09-23T14:02:27Z","updated_at":"2020-09-23T14:02:27Z","mode":"test","service":"First","carrier":"USPS","rate":"3.93","currency":"USD","retail_rate":"5.30","retail_currency":"USD","list_rate":"3.93","list_currency":"USD","delivery_days":2,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":2,"shipment_id":"shp_5bbe2086eb634ce08bf7c0bebebc4874","carrier_account_id":"ca_mtb51Ve0"},{"id":"rate_3d34ec1d2215451fb96161aa92835683","object":"Rate","created_at":"2020-09-23T14:02:27Z","updated_at":"2020-09-23T14:02:27Z","mode":"test","service":"Express","carrier":"USPS","rate":"23.00","currency":"USD","retail_rate":"26.75","retail_currency":"USD","list_rate":"23.00","list_currency":"USD","delivery_days":null,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":null,"shipment_id":"shp_5bbe2086eb634ce08bf7c0bebebc4874","carrier_account_id":"ca_mtb51Ve0"},{"id":"rate_dbd69724f2714e6e9dd08dd1109ba659","object":"Rate","created_at":"2020-09-23T14:02:27Z","updated_at":"2020-09-23T14:02:27Z","mode":"test","service":"ParcelSelect","carrier":"USPS","rate":"6.92","currency":"USD","retail_rate":"6.92","retail_currency":"USD","list_rate":"6.92","list_currency":"USD","delivery_days":2,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":2,"shipment_id":"shp_5bbe2086eb634ce08bf7c0bebebc4874","carrier_account_id":"ca_mtb51Ve0"}],"refund_status":null,"scan_form":null,"selected_rate":null,"tracker":null,"to_address":{"id":"adr_09b102bdfe394d3fb4e3244e8a39fa13","object":"Address","created_at":"2020-09-23T14:02:25Z","updated_at":"2020-09-23T14:02:25Z","name":"John
|
246
|
+
Doe","company":"Company","street1":"A Different Road","street2":"Northwest","city":"Manville","state":"NJ","zip":"08835","country":"US","phone":"5555550199","email":null,"mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":{}},"usps_zone":1,"return_address":{"id":"adr_6f05641e3fa94ffaab66b4c1c9b18aa2","object":"Address","created_at":"2020-09-23T14:02:26Z","updated_at":"2020-09-23T14:02:26Z","name":"NY
|
247
|
+
Warehouse","company":"NY Warehouse","street1":"131 S 8th Ave","street2":null,"city":"Manville","state":"NJ","zip":"08835","country":"US","phone":"2024561111","email":null,"mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":{}},"buyer_address":{"id":"adr_09b102bdfe394d3fb4e3244e8a39fa13","object":"Address","created_at":"2020-09-23T14:02:25Z","updated_at":"2020-09-23T14:02:25Z","name":"John
|
248
|
+
Doe","company":"Company","street1":"A Different Road","street2":"Northwest","city":"Manville","state":"NJ","zip":"08835","country":"US","phone":"5555550199","email":null,"mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":{}},"forms":[],"fees":[],"id":"shp_5bbe2086eb634ce08bf7c0bebebc4874","object":"Shipment"}'
|
249
|
+
recorded_at: Wed, 23 Sep 2020 14:02:27 GMT
|
250
|
+
recorded_with: VCR 6.0.0
|
@@ -0,0 +1,18 @@
|
|
1
|
+
RSpec.describe Spree::Admin::PostageLabelsController do
|
2
|
+
stub_authorization!
|
3
|
+
|
4
|
+
describe "GET #show" do
|
5
|
+
it 'redirects to the postage label', vcr: { cassette_name: 'postage_labels/show' } do
|
6
|
+
order = create(:shipped_order) do |o|
|
7
|
+
o.shipments.first.selected_shipping_rate.update!(
|
8
|
+
easy_post_rate_id: 'rate_3de1727d77d74f1a8b1bf95fcd89e1ee',
|
9
|
+
easy_post_shipment_id: 'shp_5113aed5b7494a2b85b43960f1bb26c0',
|
10
|
+
)
|
11
|
+
end
|
12
|
+
|
13
|
+
get :show, params: { shipment_id: order.shipments.first.number }
|
14
|
+
|
15
|
+
expect(response).to redirect_to('https://easypost-files.s3-us-west-2.amazonaws.com/files/postage_label/20200924/4bff5f82521649e0b65f019fabe46e02.png')
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.describe 'Postage labels' do
|
4
|
+
stub_authorization!
|
5
|
+
|
6
|
+
it "Downloading a shipment's postage label" do
|
7
|
+
order = create(:shipped_order) do |o|
|
8
|
+
o.shipments.first.selected_shipping_rate.update!(
|
9
|
+
easy_post_rate_id: 'rate_test',
|
10
|
+
easy_post_shipment_id: 'shp_test',
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
visit spree.edit_admin_order_path(order)
|
15
|
+
|
16
|
+
expect(page).to have_content(I18n.t('spree.open_postage_label'))
|
17
|
+
end
|
18
|
+
end
|