solidus_easypost 1.0.3 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +5 -5
  2. data/.circleci/config.yml +41 -0
  3. data/.gem_release.yml +5 -0
  4. data/.github/stale.yml +17 -0
  5. data/.github_changelog_generator +2 -0
  6. data/.gitignore +21 -0
  7. data/.rspec +2 -0
  8. data/.rubocop.yml +7 -0
  9. data/.rubocop_todo.yml +36 -0
  10. data/CHANGELOG.md +113 -0
  11. data/Gemfile +33 -0
  12. data/LICENSE +26 -0
  13. data/README.md +194 -0
  14. data/Rakefile +6 -0
  15. data/app/controllers/spree/admin/postage_labels_controller.rb +20 -0
  16. data/app/decorators/models/solidus_easypost/spree/carton_decorator.rb +38 -0
  17. data/app/decorators/models/solidus_easypost/spree/shipment_decorator.rb +47 -0
  18. data/app/decorators/models/solidus_easypost/spree/shipping_rate_decorator.rb +13 -0
  19. data/app/models/solidus_easypost/parcel_dimension.rb +34 -0
  20. data/app/models/solidus_easypost/return_authorization.rb +27 -0
  21. data/app/overrides/spree/admin/orders/_shipment/add_postage_label.html.erb.deface +10 -0
  22. data/bin/console +17 -0
  23. data/bin/rails +7 -0
  24. data/bin/rails-engine +13 -0
  25. data/bin/rails-sandbox +16 -0
  26. data/bin/rake +7 -0
  27. data/bin/sandbox +86 -0
  28. data/bin/setup +8 -0
  29. data/config/initializers/webhooks.rb +7 -0
  30. data/config/locales/en.yml +8 -0
  31. data/config/routes.rb +9 -0
  32. data/db/migrate/20140515024440_add_easy_post_fields_to_shipping_rate.rb +9 -0
  33. data/db/migrate/20201025110912_add_tracker_id_to_cartons.rb +6 -0
  34. data/lib/generators/solidus_easypost/install/install_generator.rb +28 -0
  35. data/lib/generators/solidus_easypost/install/templates/initializer.rb +26 -0
  36. data/lib/solidus_easypost/address_builder.rb +45 -0
  37. data/lib/solidus_easypost/calculator/base_dimension_calculator.rb +28 -0
  38. data/lib/solidus_easypost/calculator/weight_dimension_calculator.rb +22 -0
  39. data/lib/solidus_easypost/configuration.rb +34 -0
  40. data/lib/solidus_easypost/engine.rb +19 -0
  41. data/lib/solidus_easypost/errors/unknown_partial_resource_error.rb +11 -0
  42. data/lib/solidus_easypost/estimator.rb +37 -0
  43. data/lib/solidus_easypost/parcel_builder.rb +27 -0
  44. data/lib/solidus_easypost/shipment_builder.rb +32 -0
  45. data/lib/solidus_easypost/shipping_method_selector.rb +17 -0
  46. data/lib/solidus_easypost/shipping_rate_calculator.rb +9 -0
  47. data/lib/solidus_easypost/testing_support/factories/address_factory.rb +10 -0
  48. data/lib/solidus_easypost/testing_support/factories/product_factory.rb +7 -0
  49. data/lib/solidus_easypost/testing_support/factories/shipment_factory.rb +30 -0
  50. data/lib/solidus_easypost/testing_support/factories/shipping_method_factory.rb +8 -0
  51. data/lib/solidus_easypost/testing_support/factories/stock_location_factory.rb +10 -0
  52. data/lib/solidus_easypost/testing_support/factories/variant_factory.rb +7 -0
  53. data/lib/solidus_easypost/testing_support/factories.rb +3 -0
  54. data/lib/solidus_easypost/tracker_webhook_handler.rb +14 -0
  55. data/lib/solidus_easypost/version.rb +5 -0
  56. data/lib/solidus_easypost.rb +32 -0
  57. data/solidus_easypost.gemspec +41 -0
  58. data/spec/cassettes/address_builder/from_address.yml +65 -0
  59. data/spec/cassettes/address_builder/from_stock_location.yml +65 -0
  60. data/spec/cassettes/estimator.yml +269 -0
  61. data/spec/cassettes/integration/checkout.yml +377 -0
  62. data/spec/cassettes/integration/order_shipping/with_purchase_labels.yml +373 -0
  63. data/spec/cassettes/integration/order_shipping/without_purchase_labels.yml +251 -0
  64. data/spec/cassettes/parcel_builder/from_package.yml +63 -0
  65. data/spec/cassettes/parcel_builder/from_return_authorization.yml +63 -0
  66. data/spec/cassettes/postage_labels/show.yml +72 -0
  67. data/spec/cassettes/return_authorization.yml +310 -0
  68. data/spec/cassettes/shipment_builder/from_package.yml +251 -0
  69. data/spec/cassettes/shipment_builder/from_return_authorization.yml +251 -0
  70. data/spec/cassettes/shipment_builder/from_shipment.yml +250 -0
  71. data/spec/controllers/spree/admin/postage_labels_controller_spec.rb +18 -0
  72. data/spec/features/admin/postage_labels_spec.rb +18 -0
  73. data/spec/integration/checkout_spec.rb +45 -0
  74. data/spec/integration/order_shipping_spec.rb +33 -0
  75. data/spec/models/solidus_easypost/parcel_dimension_spec.rb +80 -0
  76. data/spec/models/solidus_easypost/return_authorization_spec.rb +17 -0
  77. data/spec/models/spree/carton_spec.rb +57 -0
  78. data/spec/models/spree/shipment_spec.rb +69 -0
  79. data/spec/models/spree/shipping_rate_spec.rb +23 -0
  80. data/spec/solidus_easypost/address_builder_spec.rb +17 -0
  81. data/spec/solidus_easypost/calculator/weight_dimension_calculator_spec.rb +39 -0
  82. data/spec/solidus_easypost/estimator_spec.rb +52 -0
  83. data/spec/solidus_easypost/parcel_builder_spec.rb +113 -0
  84. data/spec/solidus_easypost/shipment_builder_spec.rb +28 -0
  85. data/spec/solidus_easypost/shipping_method_selector_spec.rb +33 -0
  86. data/spec/solidus_easypost/shipping_rate_calculator_spec.rb +12 -0
  87. data/spec/solidus_easypost/tracker_webhook_handler_spec.rb +58 -0
  88. data/spec/solidus_easypost_spec.rb +19 -0
  89. data/spec/spec_helper.rb +31 -0
  90. data/spec/support/easypost.rb +5 -0
  91. data/spec/support/factory_bot.rb +3 -0
  92. data/spec/support/helpers/api_stubs.rb +40 -0
  93. data/spec/support/helpers/configuration.rb +28 -0
  94. data/spec/support/helpers/shipping_methods.rb +26 -0
  95. data/spec/support/solidus.rb +1 -0
  96. data/spec/support/vcr.rb +12 -0
  97. metadata +170 -142
@@ -0,0 +1,377 @@
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":"215 N 7th Ave","street2":"Northwest","city":"Manville","zip":"08835","phone":"555-555-0199","company":"Company","name":"John
9
+ Doe","state":"AL","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
+ - a371cbbf5f6b5314ee835c0a00036d2d
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_7dca893daf4b41fdabea858f6c2f53ca"
42
+ Content-Type:
43
+ - application/json; charset=utf-8
44
+ X-Runtime:
45
+ - '0.076608'
46
+ Transfer-Encoding:
47
+ - chunked
48
+ X-Node:
49
+ - bigweb2sj
50
+ X-Version-Label:
51
+ - easypost-202009222104-7ce76ac125-master
52
+ X-Backend:
53
+ - easypost
54
+ X-Proxied:
55
+ - extlb2wdc a561deb64e
56
+ - intlb1sj 8df81f0396
57
+ - intlb2wdc 8df81f0396
58
+ Strict-Transport-Security:
59
+ - max-age=15768000; includeSubDomains; preload
60
+ body:
61
+ encoding: ASCII-8BIT
62
+ string: '{"id":"adr_7dca893daf4b41fdabea858f6c2f53ca","object":"Address","created_at":"2020-09-23T13:52:20Z","updated_at":"2020-09-23T13:52:20Z","name":"John
63
+ Doe","company":"Company","street1":"215 N 7th Ave","street2":"Northwest","city":"Manville","state":"AL","zip":"08835","country":"US","phone":"5555550199","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 13:52:20 GMT
65
+ - request:
66
+ method: post
67
+ uri: https://api.easypost.com/v2/addresses
68
+ body:
69
+ encoding: UTF-8
70
+ string: '{"address":{"street1":"131 S 8th Ave","city":"Manville","zip":"08835","phone":"(202)
71
+ 456-1111","name":"NY Warehouse","company":"NY Warehouse","state":"NJ","country":"US"}}'
72
+ headers:
73
+ Accept-Encoding:
74
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
75
+ Accept:
76
+ - "*/*"
77
+ User-Agent:
78
+ - EasyPost/v2 RubyClient/3.1.3 Ruby/2.7.1-p83
79
+ Content-Type:
80
+ - application/json
81
+ Authorization:
82
+ - Basic Q3Z6WXR1ZGE2S1JJOUpqRzdTQUhiQTo=
83
+ response:
84
+ status:
85
+ code: 201
86
+ message: Created
87
+ headers:
88
+ X-Frame-Options:
89
+ - SAMEORIGIN
90
+ X-Xss-Protection:
91
+ - 1; mode=block
92
+ X-Content-Type-Options:
93
+ - nosniff
94
+ X-Ep-Request-Uuid:
95
+ - a371cbc15f6b5315ee81d58f00036d49
96
+ Cache-Control:
97
+ - no-cache, no-store, must-revalidate, private
98
+ Pragma:
99
+ - no-cache
100
+ Expires:
101
+ - '0'
102
+ Location:
103
+ - "/api/v2/addresses/adr_cb5a8f8f66024a589bc8016d30f256ed"
104
+ Content-Type:
105
+ - application/json; charset=utf-8
106
+ X-Runtime:
107
+ - '0.064295'
108
+ Transfer-Encoding:
109
+ - chunked
110
+ X-Node:
111
+ - bigweb12sj
112
+ X-Version-Label:
113
+ - easypost-202009222104-7ce76ac125-master
114
+ X-Backend:
115
+ - easypost
116
+ X-Proxied:
117
+ - extlb2wdc a561deb64e
118
+ - intlb1sj 8df81f0396
119
+ - intlb1wdc 8df81f0396
120
+ Strict-Transport-Security:
121
+ - max-age=15768000; includeSubDomains; preload
122
+ body:
123
+ encoding: ASCII-8BIT
124
+ string: '{"id":"adr_cb5a8f8f66024a589bc8016d30f256ed","object":"Address","created_at":"2020-09-23T13:52:21Z","updated_at":"2020-09-23T13:52:21Z","name":"NY
125
+ 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":{}}'
126
+ recorded_at: Wed, 23 Sep 2020 13:52:21 GMT
127
+ - request:
128
+ method: post
129
+ uri: https://api.easypost.com/v2/parcels
130
+ body:
131
+ encoding: UTF-8
132
+ string: '{"parcel":{"weight":"10.0"}}'
133
+ headers:
134
+ Accept-Encoding:
135
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
136
+ Accept:
137
+ - "*/*"
138
+ User-Agent:
139
+ - EasyPost/v2 RubyClient/3.1.3 Ruby/2.7.1-p83
140
+ Content-Type:
141
+ - application/json
142
+ Authorization:
143
+ - Basic Q3Z6WXR1ZGE2S1JJOUpqRzdTQUhiQTo=
144
+ response:
145
+ status:
146
+ code: 201
147
+ message: Created
148
+ headers:
149
+ X-Frame-Options:
150
+ - SAMEORIGIN
151
+ X-Xss-Protection:
152
+ - 1; mode=block
153
+ X-Content-Type-Options:
154
+ - nosniff
155
+ X-Ep-Request-Uuid:
156
+ - 937dbd605f6b5316ee725d0e00038dba
157
+ Cache-Control:
158
+ - no-cache, no-store, must-revalidate, private
159
+ Pragma:
160
+ - no-cache
161
+ Expires:
162
+ - '0'
163
+ Location:
164
+ - "/api/v2/parcels/prcl_2959712a638f4e1794999e63f6ef7f1f"
165
+ Content-Type:
166
+ - application/json; charset=utf-8
167
+ X-Runtime:
168
+ - '0.028574'
169
+ Transfer-Encoding:
170
+ - chunked
171
+ X-Node:
172
+ - bigweb8sj
173
+ X-Version-Label:
174
+ - easypost-202009222104-7ce76ac125-master
175
+ X-Backend:
176
+ - easypost
177
+ X-Proxied:
178
+ - extlb1wdc a561deb64e
179
+ - intlb1sj 8df81f0396
180
+ - intlb2wdc 8df81f0396
181
+ Strict-Transport-Security:
182
+ - max-age=15768000; includeSubDomains; preload
183
+ body:
184
+ encoding: ASCII-8BIT
185
+ string: '{"id":"prcl_2959712a638f4e1794999e63f6ef7f1f","object":"Parcel","created_at":"2020-09-23T13:52:22Z","updated_at":"2020-09-23T13:52:22Z","length":null,"width":null,"height":null,"predefined_package":null,"weight":10.0,"mode":"test"}'
186
+ recorded_at: Wed, 23 Sep 2020 13:52:22 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_7dca893daf4b41fdabea858f6c2f53ca"},"from_address":{"id":"adr_cb5a8f8f66024a589bc8016d30f256ed"},"parcel":{"id":"prcl_2959712a638f4e1794999e63f6ef7f1f"}}}'
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
+ - 937dbd5f5f6b5316ee70de3300038dce
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_031353505bc84d37aed8fba58174d4a5"
225
+ Content-Type:
226
+ - application/json; charset=utf-8
227
+ X-Runtime:
228
+ - '0.204774'
229
+ Transfer-Encoding:
230
+ - chunked
231
+ X-Node:
232
+ - bigweb4sj
233
+ X-Version-Label:
234
+ - easypost-202009222104-7ce76ac125-master
235
+ X-Backend:
236
+ - easypost
237
+ X-Proxied:
238
+ - extlb1wdc a561deb64e
239
+ - intlb1sj 8df81f0396
240
+ - intlb2wdc 8df81f0396
241
+ Strict-Transport-Security:
242
+ - max-age=15768000; includeSubDomains; preload
243
+ body:
244
+ encoding: ASCII-8BIT
245
+ string: '{"created_at":"2020-09-23T13:52:22Z","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-23T13:52:22Z","batch_id":null,"batch_status":null,"batch_message":null,"customs_info":null,"from_address":{"id":"adr_cb5a8f8f66024a589bc8016d30f256ed","object":"Address","created_at":"2020-09-23T13:52:21Z","updated_at":"2020-09-23T13:52:21Z","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_2959712a638f4e1794999e63f6ef7f1f","object":"Parcel","created_at":"2020-09-23T13:52:22Z","updated_at":"2020-09-23T13:52:22Z","length":null,"width":null,"height":null,"predefined_package":null,"weight":10.0,"mode":"test"},"postage_label":null,"rates":[{"id":"rate_f523c0e789214a31b715d97298081649","object":"Rate","created_at":"2020-09-23T13:52:23Z","updated_at":"2020-09-23T13:52:23Z","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_031353505bc84d37aed8fba58174d4a5","carrier_account_id":"ca_mtb51Ve0"},{"id":"rate_a5a7b528101d423c87a9391ceb732064","object":"Rate","created_at":"2020-09-23T13:52:23Z","updated_at":"2020-09-23T13:52:23Z","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_031353505bc84d37aed8fba58174d4a5","carrier_account_id":"ca_mtb51Ve0"},{"id":"rate_be8793b0b3164e44a44eb06e5f1de61d","object":"Rate","created_at":"2020-09-23T13:52:23Z","updated_at":"2020-09-23T13:52:23Z","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_031353505bc84d37aed8fba58174d4a5","carrier_account_id":"ca_mtb51Ve0"},{"id":"rate_300a8a37486845fb8ccf5af1d63ae566","object":"Rate","created_at":"2020-09-23T13:52:23Z","updated_at":"2020-09-23T13:52:23Z","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_031353505bc84d37aed8fba58174d4a5","carrier_account_id":"ca_mtb51Ve0"}],"refund_status":null,"scan_form":null,"selected_rate":null,"tracker":null,"to_address":{"id":"adr_7dca893daf4b41fdabea858f6c2f53ca","object":"Address","created_at":"2020-09-23T13:52:20Z","updated_at":"2020-09-23T13:52:20Z","name":"John
247
+ Doe","company":"Company","street1":"215 N 7th Ave","street2":"Northwest","city":"Manville","state":"AL","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_cb5a8f8f66024a589bc8016d30f256ed","object":"Address","created_at":"2020-09-23T13:52:21Z","updated_at":"2020-09-23T13:52:21Z","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_7dca893daf4b41fdabea858f6c2f53ca","object":"Address","created_at":"2020-09-23T13:52:20Z","updated_at":"2020-09-23T13:52:20Z","name":"John
249
+ Doe","company":"Company","street1":"215 N 7th Ave","street2":"Northwest","city":"Manville","state":"AL","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_031353505bc84d37aed8fba58174d4a5","object":"Shipment"}'
250
+ recorded_at: Wed, 23 Sep 2020 13:52:23 GMT
251
+ - request:
252
+ method: get
253
+ uri: https://api.easypost.com/v2/shipments/shp_031353505bc84d37aed8fba58174d4a5
254
+ body:
255
+ encoding: US-ASCII
256
+ string: ''
257
+ headers:
258
+ Accept-Encoding:
259
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
260
+ Accept:
261
+ - "*/*"
262
+ User-Agent:
263
+ - EasyPost/v2 RubyClient/3.1.3 Ruby/2.7.1-p83
264
+ Content-Type:
265
+ - application/json
266
+ Authorization:
267
+ - Basic Q3Z6WXR1ZGE2S1JJOUpqRzdTQUhiQTo=
268
+ response:
269
+ status:
270
+ code: 200
271
+ message: OK
272
+ headers:
273
+ X-Frame-Options:
274
+ - SAMEORIGIN
275
+ X-Xss-Protection:
276
+ - 1; mode=block
277
+ X-Content-Type-Options:
278
+ - nosniff
279
+ X-Ep-Request-Uuid:
280
+ - f168e8e25f6b5318ee61615100036967
281
+ Cache-Control:
282
+ - no-cache, no-store, must-revalidate, private
283
+ Pragma:
284
+ - no-cache
285
+ Expires:
286
+ - '0'
287
+ Content-Type:
288
+ - application/json; charset=utf-8
289
+ X-Runtime:
290
+ - '0.090077'
291
+ Transfer-Encoding:
292
+ - chunked
293
+ X-Node:
294
+ - bigweb7sj
295
+ X-Version-Label:
296
+ - easypost-202009222104-7ce76ac125-master
297
+ X-Backend:
298
+ - easypost
299
+ X-Canary:
300
+ - direct
301
+ X-Proxied:
302
+ - extlb2nuq a561deb64e
303
+ - intlb1sj 8df81f0396
304
+ - intlb2nuq 8df81f0396
305
+ Strict-Transport-Security:
306
+ - max-age=15768000; includeSubDomains; preload
307
+ body:
308
+ encoding: ASCII-8BIT
309
+ string: '{"created_at":"2020-09-23T13:52:22Z","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-23T13:52:22Z","batch_id":null,"batch_status":null,"batch_message":null,"customs_info":null,"from_address":{"id":"adr_cb5a8f8f66024a589bc8016d30f256ed","object":"Address","created_at":"2020-09-23T13:52:21Z","updated_at":"2020-09-23T13:52:21Z","name":"NY
310
+ 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_2959712a638f4e1794999e63f6ef7f1f","object":"Parcel","created_at":"2020-09-23T13:52:22Z","updated_at":"2020-09-23T13:52:22Z","length":null,"width":null,"height":null,"predefined_package":null,"weight":10.0,"mode":"test"},"postage_label":null,"rates":[{"id":"rate_f523c0e789214a31b715d97298081649","object":"Rate","created_at":"2020-09-23T13:52:23Z","updated_at":"2020-09-23T13:52:23Z","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_031353505bc84d37aed8fba58174d4a5","carrier_account_id":"ca_mtb51Ve0"},{"id":"rate_a5a7b528101d423c87a9391ceb732064","object":"Rate","created_at":"2020-09-23T13:52:23Z","updated_at":"2020-09-23T13:52:23Z","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_031353505bc84d37aed8fba58174d4a5","carrier_account_id":"ca_mtb51Ve0"},{"id":"rate_be8793b0b3164e44a44eb06e5f1de61d","object":"Rate","created_at":"2020-09-23T13:52:23Z","updated_at":"2020-09-23T13:52:23Z","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_031353505bc84d37aed8fba58174d4a5","carrier_account_id":"ca_mtb51Ve0"},{"id":"rate_300a8a37486845fb8ccf5af1d63ae566","object":"Rate","created_at":"2020-09-23T13:52:23Z","updated_at":"2020-09-23T13:52:23Z","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_031353505bc84d37aed8fba58174d4a5","carrier_account_id":"ca_mtb51Ve0"}],"refund_status":null,"scan_form":null,"selected_rate":null,"tracker":null,"to_address":{"id":"adr_7dca893daf4b41fdabea858f6c2f53ca","object":"Address","created_at":"2020-09-23T13:52:20Z","updated_at":"2020-09-23T13:52:20Z","name":"John
311
+ Doe","company":"Company","street1":"215 N 7th Ave","street2":"Northwest","city":"Manville","state":"AL","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_cb5a8f8f66024a589bc8016d30f256ed","object":"Address","created_at":"2020-09-23T13:52:21Z","updated_at":"2020-09-23T13:52:21Z","name":"NY
312
+ 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_7dca893daf4b41fdabea858f6c2f53ca","object":"Address","created_at":"2020-09-23T13:52:20Z","updated_at":"2020-09-23T13:52:20Z","name":"John
313
+ Doe","company":"Company","street1":"215 N 7th Ave","street2":"Northwest","city":"Manville","state":"AL","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_031353505bc84d37aed8fba58174d4a5","object":"Shipment"}'
314
+ recorded_at: Wed, 23 Sep 2020 13:52:24 GMT
315
+ - request:
316
+ method: post
317
+ uri: https://api.easypost.com/v2/shipments/shp_031353505bc84d37aed8fba58174d4a5/buy
318
+ body:
319
+ encoding: UTF-8
320
+ string: '{"rate":{"id":"rate_be8793b0b3164e44a44eb06e5f1de61d"}}'
321
+ headers:
322
+ Accept-Encoding:
323
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
324
+ Accept:
325
+ - "*/*"
326
+ User-Agent:
327
+ - EasyPost/v2 RubyClient/3.1.3 Ruby/2.7.1-p83
328
+ Content-Type:
329
+ - application/json
330
+ Authorization:
331
+ - Basic Q3Z6WXR1ZGE2S1JJOUpqRzdTQUhiQTo=
332
+ response:
333
+ status:
334
+ code: 200
335
+ message: OK
336
+ headers:
337
+ X-Frame-Options:
338
+ - SAMEORIGIN
339
+ X-Xss-Protection:
340
+ - 1; mode=block
341
+ X-Content-Type-Options:
342
+ - nosniff
343
+ X-Ep-Request-Uuid:
344
+ - f168e8dd5f6b5319ee7397f500036986
345
+ Cache-Control:
346
+ - no-cache, no-store, must-revalidate, private
347
+ Pragma:
348
+ - no-cache
349
+ Expires:
350
+ - '0'
351
+ Content-Type:
352
+ - application/json; charset=utf-8
353
+ X-Runtime:
354
+ - '0.888261'
355
+ Transfer-Encoding:
356
+ - chunked
357
+ X-Node:
358
+ - bigweb6sj
359
+ X-Version-Label:
360
+ - easypost-202009222104-7ce76ac125-master
361
+ X-Backend:
362
+ - easypost
363
+ X-Proxied:
364
+ - extlb2nuq a561deb64e
365
+ - intlb1sj 8df81f0396
366
+ - intlb2nuq 8df81f0396
367
+ Strict-Transport-Security:
368
+ - max-age=15768000; includeSubDomains; preload
369
+ body:
370
+ encoding: ASCII-8BIT
371
+ string: '{"created_at":"2020-09-23T13:52:22Z","is_return":false,"messages":[],"mode":"test","options":{"currency":"USD","payment":{"type":"SENDER"},"date_advance":0},"reference":null,"status":"unknown","tracking_code":"9400100897846050155390","updated_at":"2020-09-23T13:52:26Z","batch_id":null,"batch_status":null,"batch_message":null,"customs_info":null,"from_address":{"id":"adr_cb5a8f8f66024a589bc8016d30f256ed","object":"Address","created_at":"2020-09-23T13:52:21Z","updated_at":"2020-09-23T13:52:21Z","name":"NY
372
+ 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_2959712a638f4e1794999e63f6ef7f1f","object":"Parcel","created_at":"2020-09-23T13:52:22Z","updated_at":"2020-09-23T13:52:22Z","length":null,"width":null,"height":null,"predefined_package":null,"weight":10.0,"mode":"test"},"postage_label":{"object":"PostageLabel","id":"pl_444efae153da485e86796345778accee","created_at":"2020-09-23T13:52:25Z","updated_at":"2020-09-23T13:52:26Z","date_advance":0,"integrated_form":"none","label_date":"2020-09-23T13:52:25Z","label_resolution":300,"label_size":"4x6","label_type":"default","label_file_type":"image/png","label_url":"https://easypost-files.s3-us-west-2.amazonaws.com/files/postage_label/20200923/b8eead4470c24b789d9a54843aa465e1.png","label_pdf_url":null,"label_zpl_url":null,"label_epl2_url":null,"label_file":null},"rates":[{"id":"rate_f523c0e789214a31b715d97298081649","object":"Rate","created_at":"2020-09-23T13:52:23Z","updated_at":"2020-09-23T13:52:23Z","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_031353505bc84d37aed8fba58174d4a5","carrier_account_id":"ca_mtb51Ve0"},{"id":"rate_a5a7b528101d423c87a9391ceb732064","object":"Rate","created_at":"2020-09-23T13:52:23Z","updated_at":"2020-09-23T13:52:23Z","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_031353505bc84d37aed8fba58174d4a5","carrier_account_id":"ca_mtb51Ve0"},{"id":"rate_be8793b0b3164e44a44eb06e5f1de61d","object":"Rate","created_at":"2020-09-23T13:52:23Z","updated_at":"2020-09-23T13:52:23Z","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_031353505bc84d37aed8fba58174d4a5","carrier_account_id":"ca_mtb51Ve0"},{"id":"rate_300a8a37486845fb8ccf5af1d63ae566","object":"Rate","created_at":"2020-09-23T13:52:23Z","updated_at":"2020-09-23T13:52:23Z","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_031353505bc84d37aed8fba58174d4a5","carrier_account_id":"ca_mtb51Ve0"}],"refund_status":null,"scan_form":null,"selected_rate":{"id":"rate_be8793b0b3164e44a44eb06e5f1de61d","object":"Rate","created_at":"2020-09-23T13:52:25Z","updated_at":"2020-09-23T13:52:25Z","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_031353505bc84d37aed8fba58174d4a5","carrier_account_id":"ca_mtb51Ve0"},"tracker":{"id":"trk_544057aaa5a04bf59cf2fa260a08f889","object":"Tracker","mode":"test","tracking_code":"9400100897846050155390","status":"unknown","status_detail":"unknown","created_at":"2020-09-23T13:52:26Z","updated_at":"2020-09-23T13:52:26Z","signed_by":null,"weight":null,"est_delivery_date":null,"shipment_id":"shp_031353505bc84d37aed8fba58174d4a5","carrier":"USPS","tracking_details":[],"fees":[],"carrier_detail":null,"public_url":"https://track.easypost.com/djE6dHJrXzU0NDA1N2FhYTVhMDRiZjU5Y2YyZmEyNjBhMDhmODg5"},"to_address":{"id":"adr_7dca893daf4b41fdabea858f6c2f53ca","object":"Address","created_at":"2020-09-23T13:52:20Z","updated_at":"2020-09-23T13:52:20Z","name":"John
373
+ Doe","company":"Company","street1":"215 N 7th Ave","street2":"Northwest","city":"Manville","state":"AL","zip":"08835","country":"US","phone":"5555550199","email":null,"mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":{"zip4":{"success":true,"errors":[],"details":null},"delivery":{"success":true,"errors":[],"details":{"latitude":40.54849,"longitude":-74.59299,"time_zone":"America/New_York"}}}},"usps_zone":1,"return_address":{"id":"adr_cb5a8f8f66024a589bc8016d30f256ed","object":"Address","created_at":"2020-09-23T13:52:21Z","updated_at":"2020-09-23T13:52:21Z","name":"NY
374
+ 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_7dca893daf4b41fdabea858f6c2f53ca","object":"Address","created_at":"2020-09-23T13:52:20Z","updated_at":"2020-09-23T13:52:20Z","name":"John
375
+ Doe","company":"Company","street1":"215 N 7th Ave","street2":"Northwest","city":"Manville","state":"AL","zip":"08835","country":"US","phone":"5555550199","email":null,"mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":{"zip4":{"success":true,"errors":[],"details":null},"delivery":{"success":true,"errors":[],"details":{"latitude":40.54849,"longitude":-74.59299,"time_zone":"America/New_York"}}}},"forms":[],"fees":[{"object":"Fee","type":"LabelFee","amount":"0.01000","charged":true,"refunded":false},{"object":"Fee","type":"PostageFee","amount":"3.93000","charged":true,"refunded":false}],"id":"shp_031353505bc84d37aed8fba58174d4a5","object":"Shipment"}'
376
+ recorded_at: Wed, 23 Sep 2020 13:52:26 GMT
377
+ recorded_with: VCR 6.0.0