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.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +6 -0
  3. data/.github/stale.yml +4 -4
  4. data/.github_changelog_generator +2 -0
  5. data/.gitignore +1 -0
  6. data/.rubocop.yml +3 -0
  7. data/.rubocop_todo.yml +12 -47
  8. data/CHANGELOG.md +113 -0
  9. data/LICENSE +1 -1
  10. data/README.md +111 -21
  11. data/app/controllers/spree/admin/postage_labels_controller.rb +20 -0
  12. data/app/decorators/models/solidus_easypost/spree/carton_decorator.rb +38 -0
  13. data/app/decorators/models/solidus_easypost/spree/shipment_decorator.rb +18 -23
  14. data/app/models/solidus_easypost/parcel_dimension.rb +34 -0
  15. data/app/models/solidus_easypost/return_authorization.rb +2 -13
  16. data/app/overrides/spree/admin/orders/_shipment/add_postage_label.html.erb.deface +10 -0
  17. data/bin/rails +0 -1
  18. data/bin/rails-engine +0 -2
  19. data/bin/rails-sandbox +1 -2
  20. data/bin/sandbox +2 -0
  21. data/config/initializers/webhooks.rb +7 -0
  22. data/config/locales/en.yml +7 -4
  23. data/config/routes.rb +5 -1
  24. data/db/migrate/20201025110912_add_tracker_id_to_cartons.rb +6 -0
  25. data/lib/generators/solidus_easypost/install/install_generator.rb +7 -1
  26. data/lib/generators/solidus_easypost/install/templates/initializer.rb +26 -0
  27. data/lib/solidus_easypost/address_builder.rb +45 -0
  28. data/lib/solidus_easypost/calculator/base_dimension_calculator.rb +28 -0
  29. data/lib/solidus_easypost/calculator/weight_dimension_calculator.rb +22 -0
  30. data/lib/solidus_easypost/configuration.rb +25 -2
  31. data/lib/solidus_easypost/errors/unknown_partial_resource_error.rb +11 -0
  32. data/lib/solidus_easypost/estimator.rb +37 -0
  33. data/lib/solidus_easypost/parcel_builder.rb +27 -0
  34. data/lib/solidus_easypost/shipment_builder.rb +32 -0
  35. data/lib/solidus_easypost/shipping_method_selector.rb +17 -0
  36. data/lib/solidus_easypost/shipping_rate_calculator.rb +9 -0
  37. data/lib/solidus_easypost/testing_support/factories/address_factory.rb +10 -0
  38. data/lib/solidus_easypost/testing_support/factories/product_factory.rb +7 -0
  39. data/lib/solidus_easypost/testing_support/factories/shipment_factory.rb +30 -0
  40. data/lib/solidus_easypost/testing_support/factories/shipping_method_factory.rb +8 -0
  41. data/lib/solidus_easypost/testing_support/factories/stock_location_factory.rb +10 -0
  42. data/lib/solidus_easypost/testing_support/factories/variant_factory.rb +7 -0
  43. data/lib/solidus_easypost/testing_support/factories.rb +3 -0
  44. data/lib/solidus_easypost/tracker_webhook_handler.rb +14 -0
  45. data/lib/solidus_easypost/version.rb +1 -1
  46. data/lib/solidus_easypost.rb +11 -0
  47. data/solidus_easypost.gemspec +8 -5
  48. data/spec/cassettes/{Spree_Address/_easypost_address/is_an_EasyPost_Address_object.yml → address_builder/from_address.yml} +19 -23
  49. data/spec/cassettes/{Spree_StockLocation/_easypost_address/is_an_EasyPost_Address_object.yml → address_builder/from_stock_location.yml} +19 -23
  50. 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
  51. data/spec/cassettes/integration/checkout.yml +377 -0
  52. data/spec/cassettes/integration/order_shipping/with_purchase_labels.yml +373 -0
  53. data/spec/cassettes/integration/order_shipping/without_purchase_labels.yml +251 -0
  54. data/spec/cassettes/{Spree_Stock_Package/_easypost_parcel/is_an_EasyPost_Parcel_object.yml → parcel_builder/from_package.yml} +17 -22
  55. data/spec/cassettes/{Spree_Stock_Package/_easypost_parcel/has_the_correct_attributes.yml → parcel_builder/from_return_authorization.yml} +17 -22
  56. data/spec/cassettes/postage_labels/show.yml +72 -0
  57. data/spec/cassettes/return_authorization.yml +310 -0
  58. data/spec/cassettes/{Spree_Stock_Package/_easypost_shipment/is_an_EasyPost_Shipment_object.yml → shipment_builder/from_package.yml} +74 -92
  59. 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
  60. data/spec/cassettes/shipment_builder/from_shipment.yml +250 -0
  61. data/spec/controllers/spree/admin/postage_labels_controller_spec.rb +18 -0
  62. data/spec/features/admin/postage_labels_spec.rb +18 -0
  63. data/spec/integration/checkout_spec.rb +45 -0
  64. data/spec/integration/order_shipping_spec.rb +33 -0
  65. data/spec/models/solidus_easypost/parcel_dimension_spec.rb +80 -0
  66. data/spec/models/solidus_easypost/return_authorization_spec.rb +7 -40
  67. data/spec/models/spree/carton_spec.rb +57 -0
  68. data/spec/models/spree/shipment_spec.rb +48 -59
  69. data/spec/models/spree/shipping_rate_spec.rb +14 -7
  70. data/spec/solidus_easypost/address_builder_spec.rb +17 -0
  71. data/spec/solidus_easypost/calculator/weight_dimension_calculator_spec.rb +39 -0
  72. data/spec/solidus_easypost/estimator_spec.rb +52 -0
  73. data/spec/solidus_easypost/parcel_builder_spec.rb +113 -0
  74. data/spec/solidus_easypost/shipment_builder_spec.rb +28 -0
  75. data/spec/solidus_easypost/shipping_method_selector_spec.rb +33 -0
  76. data/spec/solidus_easypost/shipping_rate_calculator_spec.rb +12 -0
  77. data/spec/solidus_easypost/tracker_webhook_handler_spec.rb +58 -0
  78. data/spec/spec_helper.rb +11 -7
  79. data/spec/support/easypost.rb +3 -1
  80. data/spec/support/helpers/api_stubs.rb +40 -0
  81. data/spec/support/helpers/configuration.rb +28 -0
  82. data/spec/support/helpers/shipping_methods.rb +26 -0
  83. data/spec/support/solidus.rb +1 -0
  84. data/spec/support/vcr.rb +1 -0
  85. metadata +118 -85
  86. data/app/decorators/models/solidus_easypost/spree/address_decorator.rb +0 -30
  87. data/app/decorators/models/solidus_easypost/spree/stock/estimator_decorator.rb +0 -15
  88. data/app/decorators/models/solidus_easypost/spree/stock/package_decorator.rb +0 -27
  89. data/app/decorators/models/solidus_easypost/spree/stock_location_decorator.rb +0 -26
  90. data/app/models/solidus_easypost/estimator.rb +0 -51
  91. data/lib/solidus_easypost/factories.rb +0 -24
  92. data/spec/cassettes/SolidusEasypost_ReturnAuthorization/_easypost_shipment/is_an_EasyPost_Shipment_object.yml +0 -271
  93. data/spec/cassettes/SolidusEasypost_ReturnAuthorization/_return_label/has_the_correct_fields.yml +0 -336
  94. data/spec/cassettes/SolidusEasypost_ReturnAuthorization/_return_label/is_an_EasyPost_PackageLabel_object.yml +0 -336
  95. data/spec/cassettes/Spree_Address/_easypost_address/has_the_correct_attributes.yml +0 -69
  96. data/spec/cassettes/Spree_Order/_refresh_shipment_rates/can_get_rates_from_easy_post.yml +0 -271
  97. data/spec/cassettes/Spree_Order/_refresh_shipment_rates/create_shipping_methods_for_the_rates.yml +0 -269
  98. data/spec/cassettes/Spree_Shipment/_buys_a_shipping_rate_after_transitioning_to_ship.yml +0 -403
  99. 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
  100. data/spec/cassettes/Spree_Shipment/_easypost_shipment/when_it_is_a_new_shipment/calls_the_api.yml +0 -200
  101. 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
  102. data/spec/cassettes/Spree_Shipment/_easypost_shipment/when_it_is_an_existing_shipment/loads_the_existing_shipment.yml +0 -271
  103. data/spec/cassettes/Spree_StockLocation/_easypost_address/has_the_correct_attributes.yml +0 -69
  104. data/spec/cassettes/Spree_Stock_Estimator/_shipping_rates/when_rates_are_found/when_shipping_methods_dont_exist/creates_new_shipping_methods.yml +0 -269
  105. data/spec/cassettes/Spree_Stock_Estimator/_shipping_rates/when_rates_are_found/when_shipping_methods_dont_exist/is_empty.yml +0 -269
  106. 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
  107. 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
  108. data/spec/cassettes/Spree_Stock_Package/_easypost_shipment/calls_the_api.yml +0 -200
  109. data/spec/factories/spree_modification.rb +0 -25
  110. data/spec/models/spree/address_spec.rb +0 -31
  111. data/spec/models/spree/order_spec.rb +0 -31
  112. data/spec/models/spree/stock/estimator_spec.rb +0 -80
  113. data/spec/models/spree/stock/package_spec.rb +0 -35
  114. data/spec/models/spree/stock_location_spec.rb +0 -31
  115. data/spec/support/shipping_method_helpers.rb +0 -43
@@ -0,0 +1,251 @@
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
+ - 19e6c2535f6b531bee702f6700037b84
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_c01c9b83d73e424aa823417eff795017"
42
+ Content-Type:
43
+ - application/json; charset=utf-8
44
+ X-Runtime:
45
+ - '0.047308'
46
+ Transfer-Encoding:
47
+ - chunked
48
+ X-Node:
49
+ - bigweb12sj
50
+ X-Version-Label:
51
+ - easypost-202009222104-7ce76ac125-master
52
+ X-Backend:
53
+ - easypost
54
+ X-Proxied:
55
+ - extlb1nuq a561deb64e
56
+ - intlb1nuq 8df81f0396
57
+ - intlb1sj 8df81f0396
58
+ Strict-Transport-Security:
59
+ - max-age=15768000; includeSubDomains; preload
60
+ body:
61
+ encoding: ASCII-8BIT
62
+ string: '{"id":"adr_c01c9b83d73e424aa823417eff795017","object":"Address","created_at":"2020-09-23T13:52:27Z","updated_at":"2020-09-23T13:52:27Z","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:27 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
+ - 19e6c2505f6b531cee6169ed00037baa
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_c3f343fa69cf407f9073bd0d11b9bd00"
104
+ Content-Type:
105
+ - application/json; charset=utf-8
106
+ X-Runtime:
107
+ - '0.063412'
108
+ Transfer-Encoding:
109
+ - chunked
110
+ X-Node:
111
+ - bigweb3sj
112
+ X-Version-Label:
113
+ - easypost-202009222104-7ce76ac125-master
114
+ X-Backend:
115
+ - easypost
116
+ X-Proxied:
117
+ - extlb1nuq a561deb64e
118
+ - intlb1sj 8df81f0396
119
+ - intlb2nuq 8df81f0396
120
+ Strict-Transport-Security:
121
+ - max-age=15768000; includeSubDomains; preload
122
+ body:
123
+ encoding: ASCII-8BIT
124
+ string: '{"id":"adr_c3f343fa69cf407f9073bd0d11b9bd00","object":"Address","created_at":"2020-09-23T13:52:28Z","updated_at":"2020-09-23T13:52:28Z","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:28 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
+ - 4c4cd68b5f6b531cee8148b00002dfbb
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_c112e30e8ca245728eeed2e032106d33"
165
+ Content-Type:
166
+ - application/json; charset=utf-8
167
+ X-Runtime:
168
+ - '0.026367'
169
+ Transfer-Encoding:
170
+ - chunked
171
+ X-Node:
172
+ - bigweb12sj
173
+ X-Version-Label:
174
+ - easypost-202009222104-7ce76ac125-master
175
+ X-Backend:
176
+ - easypost
177
+ X-Proxied:
178
+ - extlb1sj a561deb64e
179
+ - intlb2sj 8df81f0396
180
+ Strict-Transport-Security:
181
+ - max-age=15768000; includeSubDomains; preload
182
+ body:
183
+ encoding: ASCII-8BIT
184
+ string: '{"id":"prcl_c112e30e8ca245728eeed2e032106d33","object":"Parcel","created_at":"2020-09-23T13:52:28Z","updated_at":"2020-09-23T13:52:28Z","length":null,"width":null,"height":null,"predefined_package":null,"weight":10.0,"mode":"test"}'
185
+ recorded_at: Wed, 23 Sep 2020 13:52:29 GMT
186
+ - request:
187
+ method: post
188
+ uri: https://api.easypost.com/v2/shipments
189
+ body:
190
+ encoding: UTF-8
191
+ string: '{"shipment":{"to_address":{"id":"adr_c01c9b83d73e424aa823417eff795017"},"from_address":{"id":"adr_c3f343fa69cf407f9073bd0d11b9bd00"},"parcel":{"id":"prcl_c112e30e8ca245728eeed2e032106d33"}}}'
192
+ headers:
193
+ Accept-Encoding:
194
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
195
+ Accept:
196
+ - "*/*"
197
+ User-Agent:
198
+ - EasyPost/v2 RubyClient/3.1.3 Ruby/2.7.1-p83
199
+ Content-Type:
200
+ - application/json
201
+ Authorization:
202
+ - Basic Q3Z6WXR1ZGE2S1JJOUpqRzdTQUhiQTo=
203
+ response:
204
+ status:
205
+ code: 201
206
+ message: Created
207
+ headers:
208
+ X-Frame-Options:
209
+ - SAMEORIGIN
210
+ X-Xss-Protection:
211
+ - 1; mode=block
212
+ X-Content-Type-Options:
213
+ - nosniff
214
+ X-Ep-Request-Uuid:
215
+ - 4c4cd68c5f6b531dee7147ca0002dfe0
216
+ Cache-Control:
217
+ - no-cache, no-store, must-revalidate, private
218
+ Pragma:
219
+ - no-cache
220
+ Expires:
221
+ - '0'
222
+ Location:
223
+ - "/api/v2/shipments/shp_710e9784aa4741c1bfbdc5a55066fa03"
224
+ Content-Type:
225
+ - application/json; charset=utf-8
226
+ X-Runtime:
227
+ - '0.214602'
228
+ Transfer-Encoding:
229
+ - chunked
230
+ X-Node:
231
+ - bigweb7sj
232
+ X-Version-Label:
233
+ - easypost-202009222104-7ce76ac125-master
234
+ X-Backend:
235
+ - easypost
236
+ X-Canary:
237
+ - direct
238
+ X-Proxied:
239
+ - extlb1sj a561deb64e
240
+ - intlb2sj 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:29Z","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:29Z","batch_id":null,"batch_status":null,"batch_message":null,"customs_info":null,"from_address":{"id":"adr_c3f343fa69cf407f9073bd0d11b9bd00","object":"Address","created_at":"2020-09-23T13:52:28Z","updated_at":"2020-09-23T13:52:28Z","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_c112e30e8ca245728eeed2e032106d33","object":"Parcel","created_at":"2020-09-23T13:52:28Z","updated_at":"2020-09-23T13:52:28Z","length":null,"width":null,"height":null,"predefined_package":null,"weight":10.0,"mode":"test"},"postage_label":null,"rates":[{"id":"rate_4e2ed3c5f40d4419860f58f7161bfe3d","object":"Rate","created_at":"2020-09-23T13:52:29Z","updated_at":"2020-09-23T13:52:29Z","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_710e9784aa4741c1bfbdc5a55066fa03","carrier_account_id":"ca_mtb51Ve0"},{"id":"rate_f431b917fc1948d183b681886d2d1b91","object":"Rate","created_at":"2020-09-23T13:52:29Z","updated_at":"2020-09-23T13:52:29Z","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_710e9784aa4741c1bfbdc5a55066fa03","carrier_account_id":"ca_mtb51Ve0"},{"id":"rate_65a2b4e07c1d49b091847f85c6695233","object":"Rate","created_at":"2020-09-23T13:52:29Z","updated_at":"2020-09-23T13:52:29Z","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_710e9784aa4741c1bfbdc5a55066fa03","carrier_account_id":"ca_mtb51Ve0"},{"id":"rate_d758933d53be45b1b0a18d9f014df383","object":"Rate","created_at":"2020-09-23T13:52:29Z","updated_at":"2020-09-23T13:52:29Z","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_710e9784aa4741c1bfbdc5a55066fa03","carrier_account_id":"ca_mtb51Ve0"}],"refund_status":null,"scan_form":null,"selected_rate":null,"tracker":null,"to_address":{"id":"adr_c01c9b83d73e424aa823417eff795017","object":"Address","created_at":"2020-09-23T13:52:27Z","updated_at":"2020-09-23T13:52:27Z","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_c3f343fa69cf407f9073bd0d11b9bd00","object":"Address","created_at":"2020-09-23T13:52:28Z","updated_at":"2020-09-23T13:52:28Z","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_c01c9b83d73e424aa823417eff795017","object":"Address","created_at":"2020-09-23T13:52:27Z","updated_at":"2020-09-23T13:52:27Z","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_710e9784aa4741c1bfbdc5a55066fa03","object":"Shipment"}'
250
+ recorded_at: Wed, 23 Sep 2020 13:52:30 GMT
251
+ recorded_with: VCR 6.0.0
@@ -5,22 +5,18 @@ http_interactions:
5
5
  uri: https://api.easypost.com/v2/parcels
6
6
  body:
7
7
  encoding: UTF-8
8
- string: parcel[weight]=10.0
8
+ string: '{"parcel":{"weight":"10.0"}}'
9
9
  headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
10
12
  Accept:
11
13
  - "*/*"
12
14
  User-Agent:
13
- - EasyPost/v2 RubyClient/3.0.1
14
- Authorization:
15
- - Bearer CvzYtuda6KRI9JjG7SAHbA
15
+ - EasyPost/v2 RubyClient/3.1.3 Ruby/2.7.1-p83
16
16
  Content-Type:
17
- - application/x-www-form-urlencoded
18
- Content-Length:
19
- - '19'
20
- Accept-Encoding:
21
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
22
- Host:
23
- - api.easypost.com
17
+ - application/json
18
+ Authorization:
19
+ - Basic Q3Z6WXR1ZGE2S1JJOUpqRzdTQUhiQTo=
24
20
  response:
25
21
  status:
26
22
  code: 201
@@ -33,7 +29,7 @@ http_interactions:
33
29
  X-Content-Type-Options:
34
30
  - nosniff
35
31
  X-Ep-Request-Uuid:
36
- - 43c6543d5dca6f1cee6f11e400010e6b
32
+ - 937dbd5e5f6b5578ee7306ae0003eaee
37
33
  Cache-Control:
38
34
  - no-cache, no-store, must-revalidate, private
39
35
  Pragma:
@@ -41,28 +37,27 @@ http_interactions:
41
37
  Expires:
42
38
  - '0'
43
39
  Location:
44
- - "/api/v2/parcels/prcl_c3e6ea88b23f41668fa53fa70d4a99e0"
40
+ - "/api/v2/parcels/prcl_00995bcdb21d403a90b95841899e14fe"
45
41
  Content-Type:
46
42
  - application/json; charset=utf-8
47
43
  X-Runtime:
48
- - '0.026856'
44
+ - '0.035066'
49
45
  Transfer-Encoding:
50
46
  - chunked
51
47
  X-Node:
52
48
  - bigweb6sj
53
49
  X-Version-Label:
54
- - easypost-201911120131-f5c72b1880-master
50
+ - easypost-202009222104-7ce76ac125-master
55
51
  X-Backend:
56
52
  - easypost
57
53
  X-Proxied:
58
- - extlb2wdc 2744487620
59
- - intlb1wdc ff5a2958df
60
- - intlb2sj ff5a2958df
54
+ - extlb1wdc a561deb64e
55
+ - intlb1sj 8df81f0396
56
+ - intlb2wdc 8df81f0396
61
57
  Strict-Transport-Security:
62
58
  - max-age=15768000; includeSubDomains; preload
63
59
  body:
64
60
  encoding: ASCII-8BIT
65
- string: '{"id":"prcl_c3e6ea88b23f41668fa53fa70d4a99e0","object":"Parcel","created_at":"2019-11-12T08:36:44Z","updated_at":"2019-11-12T08:36:44Z","length":null,"width":null,"height":null,"predefined_package":null,"weight":10.0,"mode":"test"}'
66
- http_version:
67
- recorded_at: Tue, 12 Nov 2019 08:36:44 GMT
68
- recorded_with: VCR 5.0.0
61
+ string: '{"id":"prcl_00995bcdb21d403a90b95841899e14fe","object":"Parcel","created_at":"2020-09-23T14:02:32Z","updated_at":"2020-09-23T14:02:32Z","length":null,"width":null,"height":null,"predefined_package":null,"weight":10.0,"mode":"test"}'
62
+ recorded_at: Wed, 23 Sep 2020 14:02:32 GMT
63
+ recorded_with: VCR 6.0.0
@@ -5,22 +5,18 @@ http_interactions:
5
5
  uri: https://api.easypost.com/v2/parcels
6
6
  body:
7
7
  encoding: UTF-8
8
- string: parcel[weight]=10.0
8
+ string: '{"parcel":{"weight":10}}'
9
9
  headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
10
12
  Accept:
11
13
  - "*/*"
12
14
  User-Agent:
13
- - EasyPost/v2 RubyClient/3.0.1
14
- Authorization:
15
- - Bearer CvzYtuda6KRI9JjG7SAHbA
15
+ - EasyPost/v2 RubyClient/3.1.3 Ruby/2.7.1-p83
16
16
  Content-Type:
17
- - application/x-www-form-urlencoded
18
- Content-Length:
19
- - '19'
20
- Accept-Encoding:
21
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
22
- Host:
23
- - api.easypost.com
17
+ - application/json
18
+ Authorization:
19
+ - Basic Q3Z6WXR1ZGE2S1JJOUpqRzdTQUhiQTo=
24
20
  response:
25
21
  status:
26
22
  code: 201
@@ -33,7 +29,7 @@ http_interactions:
33
29
  X-Content-Type-Options:
34
30
  - nosniff
35
31
  X-Ep-Request-Uuid:
36
- - 43c6543d5dca6f1bee7306ac00010e5b
32
+ - 937dbd5e5f6b55dcee71d5090003fbe4
37
33
  Cache-Control:
38
34
  - no-cache, no-store, must-revalidate, private
39
35
  Pragma:
@@ -41,28 +37,27 @@ http_interactions:
41
37
  Expires:
42
38
  - '0'
43
39
  Location:
44
- - "/api/v2/parcels/prcl_dc3dbb0bc49f443f85749697f4eddccd"
40
+ - "/api/v2/parcels/prcl_64223967a3804dfd8b899334967f5f76"
45
41
  Content-Type:
46
42
  - application/json; charset=utf-8
47
43
  X-Runtime:
48
- - '0.028555'
44
+ - '0.029124'
49
45
  Transfer-Encoding:
50
46
  - chunked
51
47
  X-Node:
52
48
  - bigweb3sj
53
49
  X-Version-Label:
54
- - easypost-201911120131-f5c72b1880-master
50
+ - easypost-202009222104-7ce76ac125-master
55
51
  X-Backend:
56
52
  - easypost
57
53
  X-Proxied:
58
- - extlb2wdc 2744487620
59
- - intlb1sj ff5a2958df
60
- - intlb1wdc ff5a2958df
54
+ - extlb1wdc a561deb64e
55
+ - intlb2sj 8df81f0396
56
+ - intlb2wdc 8df81f0396
61
57
  Strict-Transport-Security:
62
58
  - max-age=15768000; includeSubDomains; preload
63
59
  body:
64
60
  encoding: ASCII-8BIT
65
- string: '{"id":"prcl_dc3dbb0bc49f443f85749697f4eddccd","object":"Parcel","created_at":"2019-11-12T08:36:43Z","updated_at":"2019-11-12T08:36:43Z","length":null,"width":null,"height":null,"predefined_package":null,"weight":10.0,"mode":"test"}'
66
- http_version:
67
- recorded_at: Tue, 12 Nov 2019 08:36:44 GMT
68
- recorded_with: VCR 5.0.0
61
+ string: '{"id":"prcl_64223967a3804dfd8b899334967f5f76","object":"Parcel","created_at":"2020-09-23T14:04:13Z","updated_at":"2020-09-23T14:04:13Z","length":null,"width":null,"height":null,"predefined_package":null,"weight":10.0,"mode":"test"}'
62
+ recorded_at: Wed, 23 Sep 2020 14:04:13 GMT
63
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,72 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.easypost.com/v2/shipments/shp_5113aed5b7494a2b85b43960f1bb26c0
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - EasyPost/v2 RubyClient/3.1.3 Ruby/2.7.1-p83
16
+ Content-Type:
17
+ - application/json
18
+ Authorization:
19
+ - Basic Q3Z6WXR1ZGE2S1JJOUpqRzdTQUhiQTo=
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ X-Frame-Options:
26
+ - SAMEORIGIN
27
+ X-Xss-Protection:
28
+ - 1; mode=block
29
+ X-Content-Type-Options:
30
+ - nosniff
31
+ X-Ep-Request-Uuid:
32
+ - f10f0aca5f6c653dee72657100017eda
33
+ Cache-Control:
34
+ - no-cache, no-store, must-revalidate, private
35
+ Pragma:
36
+ - no-cache
37
+ Expires:
38
+ - '0'
39
+ Content-Type:
40
+ - application/json; charset=utf-8
41
+ X-Runtime:
42
+ - '0.107495'
43
+ Transfer-Encoding:
44
+ - chunked
45
+ X-Node:
46
+ - bigweb7sj
47
+ X-Version-Label:
48
+ - easypost-202009232240-e4ac3f5991-master
49
+ X-Backend:
50
+ - easypost
51
+ X-Canary:
52
+ - direct
53
+ X-Proxied:
54
+ - extlb2wdc a561deb64e
55
+ - intlb2sj 8df81f0396
56
+ - intlb2wdc 8df81f0396
57
+ Strict-Transport-Security:
58
+ - max-age=15768000; includeSubDomains; preload
59
+ body:
60
+ encoding: ASCII-8BIT
61
+ string: '{"created_at":"2020-09-24T09:22:00Z","is_return":false,"messages":[],"mode":"test","options":{"currency":"USD","payment":{"type":"SENDER"},"date_advance":0},"reference":null,"status":"unknown","tracking_code":"9400100897846050198458","updated_at":"2020-09-24T09:22:03Z","batch_id":null,"batch_status":null,"batch_message":null,"customs_info":null,"from_address":{"id":"adr_caeb5049e6e24c1a8dbf67ac454a8589","object":"Address","created_at":"2020-09-24T09:21:58Z","updated_at":"2020-09-24T09:21:58Z","name":"NY
62
+ 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_d66b9d5210c449f1990b17e1984af7e0","object":"Parcel","created_at":"2020-09-24T09:21:59Z","updated_at":"2020-09-24T09:21:59Z","length":null,"width":null,"height":null,"predefined_package":null,"weight":10.0,"mode":"test"},"postage_label":{"object":"PostageLabel","id":"pl_700eed07e9aa4d0fa1db42bf571d47ef","created_at":"2020-09-24T09:22:03Z","updated_at":"2020-09-24T09:22:03Z","date_advance":0,"integrated_form":"none","label_date":"2020-09-24T09:22:03Z","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/20200924/4bff5f82521649e0b65f019fabe46e02.png","label_pdf_url":null,"label_zpl_url":null,"label_epl2_url":null,"label_file":null},"rates":[{"id":"rate_f0c8b7c14020431eb1dd79d6263a2ac7","object":"Rate","created_at":"2020-09-24T09:22:00Z","updated_at":"2020-09-24T09:22:00Z","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_5113aed5b7494a2b85b43960f1bb26c0","carrier_account_id":"ca_mtb51Ve0"},{"id":"rate_3de1727d77d74f1a8b1bf95fcd89e1ee","object":"Rate","created_at":"2020-09-24T09:22:00Z","updated_at":"2020-09-24T09:22:00Z","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_5113aed5b7494a2b85b43960f1bb26c0","carrier_account_id":"ca_mtb51Ve0"},{"id":"rate_e1e9a6ebd281400a828cae1b91933a8c","object":"Rate","created_at":"2020-09-24T09:22:00Z","updated_at":"2020-09-24T09:22:00Z","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_5113aed5b7494a2b85b43960f1bb26c0","carrier_account_id":"ca_mtb51Ve0"},{"id":"rate_63b8cb8ffaac41f08566755aea41d9d2","object":"Rate","created_at":"2020-09-24T09:22:00Z","updated_at":"2020-09-24T09:22:00Z","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_5113aed5b7494a2b85b43960f1bb26c0","carrier_account_id":"ca_mtb51Ve0"}],"refund_status":null,"scan_form":null,"selected_rate":{"id":"rate_3de1727d77d74f1a8b1bf95fcd89e1ee","object":"Rate","created_at":"2020-09-24T09:22:03Z","updated_at":"2020-09-24T09:22:03Z","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_5113aed5b7494a2b85b43960f1bb26c0","carrier_account_id":"ca_mtb51Ve0"},"tracker":{"id":"trk_42817fdea3e0487680946bd2b3cfae94","object":"Tracker","mode":"test","tracking_code":"9400100897846050198458","status":"pre_transit","status_detail":"status_update","created_at":"2020-09-24T09:22:03Z","updated_at":"2020-09-24T09:22:03Z","signed_by":null,"weight":null,"est_delivery_date":"2020-09-24T09:22:03Z","shipment_id":"shp_5113aed5b7494a2b85b43960f1bb26c0","carrier":"USPS","tracking_details":[{"object":"TrackingDetail","message":"Pre-Shipment
63
+ Info Sent to USPS","description":null,"status":"pre_transit","status_detail":"status_update","datetime":"2020-08-24T09:22:03Z","source":"USPS","carrier_code":null,"tracking_location":{"object":"TrackingLocation","city":null,"state":null,"country":null,"zip":null}},{"object":"TrackingDetail","message":"Shipping
64
+ Label Created","description":null,"status":"pre_transit","status_detail":"status_update","datetime":"2020-08-24T21:59:03Z","source":"USPS","carrier_code":null,"tracking_location":{"object":"TrackingLocation","city":"HOUSTON","state":"TX","country":null,"zip":"77063"}}],"fees":[],"carrier_detail":{"object":"CarrierDetail","service":"First-Class
65
+ Package Service","container_type":null,"est_delivery_date_local":null,"est_delivery_time_local":null,"origin_location":"HOUSTON
66
+ TX, 77001","origin_tracking_location":{"object":"TrackingLocation","city":"HOUSTON","state":"TX","country":null,"zip":"77063"},"destination_location":"CHARLESTON
67
+ SC, 29401","destination_tracking_location":null,"guaranteed_delivery_date":null,"alternate_identifier":null,"initial_delivery_attempt":null},"public_url":"https://track.easypost.com/djE6dHJrXzQyODE3ZmRlYTNlMDQ4NzY4MDk0NmJkMmIzY2ZhZTk0"},"to_address":{"id":"adr_3ecc10027f1a42fe82fca47483e2fdae","object":"Address","created_at":"2020-09-24T09:21:58Z","updated_at":"2020-09-24T09:22:02Z","name":"JOHN
68
+ DOE","company":"COMPANY","street1":"215 N 7TH AVE","street2":"NORTHWEST","city":"MANVILLE","state":"NJ","zip":"08835-1215","country":"US","phone":"5555550199","email":null,"mode":"test","carrier_facility":null,"residential":true,"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_caeb5049e6e24c1a8dbf67ac454a8589","object":"Address","created_at":"2020-09-24T09:21:58Z","updated_at":"2020-09-24T09:21:58Z","name":"NY
69
+ 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_3ecc10027f1a42fe82fca47483e2fdae","object":"Address","created_at":"2020-09-24T09:21:58Z","updated_at":"2020-09-24T09:22:02Z","name":"JOHN
70
+ DOE","company":"COMPANY","street1":"215 N 7TH AVE","street2":"NORTHWEST","city":"MANVILLE","state":"NJ","zip":"08835-1215","country":"US","phone":"5555550199","email":null,"mode":"test","carrier_facility":null,"residential":true,"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_5113aed5b7494a2b85b43960f1bb26c0","object":"Shipment"}'
71
+ recorded_at: Thu, 24 Sep 2020 09:22:06 GMT
72
+ recorded_with: VCR 6.0.0