active_shipping 1.9.0 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/active_shipping/carriers/ups.rb +7 -1
- data/lib/active_shipping/rate_estimate.rb +2 -1
- data/lib/active_shipping/version.rb +1 -1
- data/test/fixtures/xml/ups/no_negotiated_rates.xml +253 -0
- data/test/fixtures/xml/ups/no_shipment_warnings.xml +237 -0
- data/test/unit/carriers/ups_test.rb +25 -0
- data/test/unit/rate_estimate_test.rb +5 -0
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35f8804deab23b0097e6634e38f5362e7405deb1
|
4
|
+
data.tar.gz: 5d613b26ea25932bb680d0445727af22e491db98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f47ae3a28f3bbbf2ca8e8ad8f9a661e1b4946f7f2099315e95e3aa0e0e76462f06f3ee567898e4113eef96a9eadd53c5f586a9168efee27a5b1ad2e2dea1ca5f
|
7
|
+
data.tar.gz: 2aaf97578666abda403a35e48ad38c45111ab6944bf860c7ad29f8cfb9354e85fe03b16e69e89e49898f632cb28a2b18dd36c7d10b5810b265f24e4939d3f34d
|
@@ -803,6 +803,7 @@ module ActiveShipping
|
|
803
803
|
service_code = rated_shipment.at('Service/Code').text
|
804
804
|
days_to_delivery = rated_shipment.at('GuaranteedDaysToDelivery').text.to_i
|
805
805
|
days_to_delivery = nil if days_to_delivery == 0
|
806
|
+
warning_messages = rate_warning_messages(rated_shipment)
|
806
807
|
RateEstimate.new(origin, destination, @@name, service_name_for(origin, service_code),
|
807
808
|
:total_price => rated_shipment.at('TotalCharges/MonetaryValue').text.to_f,
|
808
809
|
:insurance_price => rated_shipment.at('ServiceOptionsCharges/MonetaryValue').text.to_f,
|
@@ -810,7 +811,8 @@ module ActiveShipping
|
|
810
811
|
:service_code => service_code,
|
811
812
|
:packages => packages,
|
812
813
|
:delivery_range => [timestamp_from_business_day(days_to_delivery)],
|
813
|
-
:negotiated_rate => rated_shipment.at('NegotiatedRates/NetSummaryCharges/GrandTotal/MonetaryValue').try(:text).to_f
|
814
|
+
:negotiated_rate => rated_shipment.at('NegotiatedRates/NetSummaryCharges/GrandTotal/MonetaryValue').try(:text).to_f,
|
815
|
+
:messages => warning_messages
|
814
816
|
)
|
815
817
|
end
|
816
818
|
end
|
@@ -998,6 +1000,10 @@ module ActiveShipping
|
|
998
1000
|
[status, desc].select(&:present?).join(": ").presence || "UPS could not process the request."
|
999
1001
|
end
|
1000
1002
|
|
1003
|
+
def rate_warning_messages(rate_xml)
|
1004
|
+
rate_xml.xpath("RatedShipmentWarning").map { |warning| warning.text }
|
1005
|
+
end
|
1006
|
+
|
1001
1007
|
def response_digest(xml)
|
1002
1008
|
xml.root.at('ShipmentDigest').text
|
1003
1009
|
end
|
@@ -86,7 +86,7 @@ module ActiveShipping
|
|
86
86
|
:currency, :negotiated_rate, :insurance_price,
|
87
87
|
:estimate_reference, :expires_at, :pickup_time,
|
88
88
|
:compare_price, :phone_required, :delivery_category,
|
89
|
-
:shipment_options, :charge_items
|
89
|
+
:shipment_options, :charge_items, :messages
|
90
90
|
|
91
91
|
def initialize(origin, destination, carrier, service_name, options = {})
|
92
92
|
self.origin, self.destination, self.carrier, self.service_name = origin, destination, carrier, service_name
|
@@ -112,6 +112,7 @@ module ActiveShipping
|
|
112
112
|
self.delivery_category = options[:delivery_category]
|
113
113
|
self.shipment_options = options[:shipment_options] || []
|
114
114
|
self.charge_items = options[:charge_items] || []
|
115
|
+
self.messages = options[:messages] || []
|
115
116
|
end
|
116
117
|
|
117
118
|
# The total price of the shipments in cents.
|
@@ -0,0 +1,253 @@
|
|
1
|
+
<?xml version="1.0" ?>
|
2
|
+
<RatingServiceSelectionResponse>
|
3
|
+
<Response>
|
4
|
+
<ResponseStatusCode>1</ResponseStatusCode>
|
5
|
+
<ResponseStatusDescription>Success</ResponseStatusDescription>
|
6
|
+
</Response>
|
7
|
+
<RatedShipment>
|
8
|
+
<Service>
|
9
|
+
<Code>03</Code>
|
10
|
+
</Service>
|
11
|
+
<RatedShipmentWarning>User Id and Shipper Number combination is not qualified to receive negotiated rates.</RatedShipmentWarning>
|
12
|
+
<RatedShipmentWarning>Your invoice may vary from the displayed reference rates</RatedShipmentWarning>
|
13
|
+
<RatedShipmentWarning>Ship To Address Classification is changed from Residential to Commercial</RatedShipmentWarning>
|
14
|
+
<BillingWeight>
|
15
|
+
<UnitOfMeasurement>
|
16
|
+
<Code>LBS</Code>
|
17
|
+
</UnitOfMeasurement>
|
18
|
+
<Weight>4.0</Weight>
|
19
|
+
</BillingWeight>
|
20
|
+
<TransportationCharges>
|
21
|
+
<CurrencyCode>USD</CurrencyCode>
|
22
|
+
<MonetaryValue>10.85</MonetaryValue>
|
23
|
+
</TransportationCharges>
|
24
|
+
<ServiceOptionsCharges>
|
25
|
+
<CurrencyCode>USD</CurrencyCode>
|
26
|
+
<MonetaryValue>0.00</MonetaryValue>
|
27
|
+
</ServiceOptionsCharges>
|
28
|
+
<TotalCharges>
|
29
|
+
<CurrencyCode>USD</CurrencyCode>
|
30
|
+
<MonetaryValue>10.85</MonetaryValue>
|
31
|
+
</TotalCharges>
|
32
|
+
<GuaranteedDaysToDelivery/>
|
33
|
+
<ScheduledDeliveryTime/>
|
34
|
+
<RatedPackage>
|
35
|
+
<TransportationCharges>
|
36
|
+
<CurrencyCode>USD</CurrencyCode>
|
37
|
+
<MonetaryValue>10.85</MonetaryValue>
|
38
|
+
</TransportationCharges>
|
39
|
+
<ServiceOptionsCharges>
|
40
|
+
<CurrencyCode>USD</CurrencyCode>
|
41
|
+
<MonetaryValue>0.00</MonetaryValue>
|
42
|
+
</ServiceOptionsCharges>
|
43
|
+
<TotalCharges>
|
44
|
+
<CurrencyCode>USD</CurrencyCode>
|
45
|
+
<MonetaryValue>10.85</MonetaryValue>
|
46
|
+
</TotalCharges>
|
47
|
+
<Weight>2.7</Weight>
|
48
|
+
<BillingWeight>
|
49
|
+
<UnitOfMeasurement>
|
50
|
+
<Code>LBS</Code>
|
51
|
+
</UnitOfMeasurement>
|
52
|
+
<Weight>4.0</Weight>
|
53
|
+
</BillingWeight>
|
54
|
+
</RatedPackage>
|
55
|
+
</RatedShipment>
|
56
|
+
<RatedShipment>
|
57
|
+
<Service>
|
58
|
+
<Code>12</Code>
|
59
|
+
</Service>
|
60
|
+
<RatedShipmentWarning>User Id and Shipper Number combination is not qualified to receive negotiated rates.</RatedShipmentWarning>
|
61
|
+
<RatedShipmentWarning>Your invoice may vary from the displayed reference rates</RatedShipmentWarning>
|
62
|
+
<RatedShipmentWarning>Ship To Address Classification is changed from Residential to Commercial</RatedShipmentWarning>
|
63
|
+
<BillingWeight>
|
64
|
+
<UnitOfMeasurement>
|
65
|
+
<Code>LBS</Code>
|
66
|
+
</UnitOfMeasurement>
|
67
|
+
<Weight>4.0</Weight>
|
68
|
+
</BillingWeight>
|
69
|
+
<TransportationCharges>
|
70
|
+
<CurrencyCode>USD</CurrencyCode>
|
71
|
+
<MonetaryValue>14.56</MonetaryValue>
|
72
|
+
</TransportationCharges>
|
73
|
+
<ServiceOptionsCharges>
|
74
|
+
<CurrencyCode>USD</CurrencyCode>
|
75
|
+
<MonetaryValue>0.00</MonetaryValue>
|
76
|
+
</ServiceOptionsCharges>
|
77
|
+
<TotalCharges>
|
78
|
+
<CurrencyCode>USD</CurrencyCode>
|
79
|
+
<MonetaryValue>14.56</MonetaryValue>
|
80
|
+
</TotalCharges>
|
81
|
+
<GuaranteedDaysToDelivery>3</GuaranteedDaysToDelivery>
|
82
|
+
<ScheduledDeliveryTime/>
|
83
|
+
<RatedPackage>
|
84
|
+
<TransportationCharges>
|
85
|
+
<CurrencyCode>USD</CurrencyCode>
|
86
|
+
<MonetaryValue>14.56</MonetaryValue>
|
87
|
+
</TransportationCharges>
|
88
|
+
<ServiceOptionsCharges>
|
89
|
+
<CurrencyCode>USD</CurrencyCode>
|
90
|
+
<MonetaryValue>0.00</MonetaryValue>
|
91
|
+
</ServiceOptionsCharges>
|
92
|
+
<TotalCharges>
|
93
|
+
<CurrencyCode>USD</CurrencyCode>
|
94
|
+
<MonetaryValue>14.56</MonetaryValue>
|
95
|
+
</TotalCharges>
|
96
|
+
<Weight>2.7</Weight>
|
97
|
+
<BillingWeight>
|
98
|
+
<UnitOfMeasurement>
|
99
|
+
<Code>LBS</Code>
|
100
|
+
</UnitOfMeasurement>
|
101
|
+
<Weight>4.0</Weight>
|
102
|
+
</BillingWeight>
|
103
|
+
</RatedPackage>
|
104
|
+
</RatedShipment>
|
105
|
+
<RatedShipment>
|
106
|
+
<Service>
|
107
|
+
<Code>02</Code>
|
108
|
+
</Service>
|
109
|
+
<RatedShipmentWarning>User Id and Shipper Number combination is not qualified to receive negotiated rates.</RatedShipmentWarning>
|
110
|
+
<RatedShipmentWarning>Your invoice may vary from the displayed reference rates</RatedShipmentWarning>
|
111
|
+
<RatedShipmentWarning>Ship To Address Classification is changed from Residential to Commercial</RatedShipmentWarning>
|
112
|
+
<BillingWeight>
|
113
|
+
<UnitOfMeasurement>
|
114
|
+
<Code>LBS</Code>
|
115
|
+
</UnitOfMeasurement>
|
116
|
+
<Weight>4.0</Weight>
|
117
|
+
</BillingWeight>
|
118
|
+
<TransportationCharges>
|
119
|
+
<CurrencyCode>USD</CurrencyCode>
|
120
|
+
<MonetaryValue>19.94</MonetaryValue>
|
121
|
+
</TransportationCharges>
|
122
|
+
<ServiceOptionsCharges>
|
123
|
+
<CurrencyCode>USD</CurrencyCode>
|
124
|
+
<MonetaryValue>0.00</MonetaryValue>
|
125
|
+
</ServiceOptionsCharges>
|
126
|
+
<TotalCharges>
|
127
|
+
<CurrencyCode>USD</CurrencyCode>
|
128
|
+
<MonetaryValue>19.94</MonetaryValue>
|
129
|
+
</TotalCharges>
|
130
|
+
<GuaranteedDaysToDelivery>2</GuaranteedDaysToDelivery>
|
131
|
+
<ScheduledDeliveryTime/>
|
132
|
+
<RatedPackage>
|
133
|
+
<TransportationCharges>
|
134
|
+
<CurrencyCode>USD</CurrencyCode>
|
135
|
+
<MonetaryValue>19.94</MonetaryValue>
|
136
|
+
</TransportationCharges>
|
137
|
+
<ServiceOptionsCharges>
|
138
|
+
<CurrencyCode>USD</CurrencyCode>
|
139
|
+
<MonetaryValue>0.00</MonetaryValue>
|
140
|
+
</ServiceOptionsCharges>
|
141
|
+
<TotalCharges>
|
142
|
+
<CurrencyCode>USD</CurrencyCode>
|
143
|
+
<MonetaryValue>19.94</MonetaryValue>
|
144
|
+
</TotalCharges>
|
145
|
+
<Weight>2.7</Weight>
|
146
|
+
<BillingWeight>
|
147
|
+
<UnitOfMeasurement>
|
148
|
+
<Code>LBS</Code>
|
149
|
+
</UnitOfMeasurement>
|
150
|
+
<Weight>4.0</Weight>
|
151
|
+
</BillingWeight>
|
152
|
+
</RatedPackage>
|
153
|
+
</RatedShipment>
|
154
|
+
<RatedShipment>
|
155
|
+
<Service>
|
156
|
+
<Code>14</Code>
|
157
|
+
</Service>
|
158
|
+
<RatedShipmentWarning>User Id and Shipper Number combination is not qualified to receive negotiated rates.</RatedShipmentWarning>
|
159
|
+
<RatedShipmentWarning>Your invoice may vary from the displayed reference rates</RatedShipmentWarning>
|
160
|
+
<RatedShipmentWarning>Ship To Address Classification is changed from Residential to Commercial</RatedShipmentWarning>
|
161
|
+
<BillingWeight>
|
162
|
+
<UnitOfMeasurement>
|
163
|
+
<Code>LBS</Code>
|
164
|
+
</UnitOfMeasurement>
|
165
|
+
<Weight>4.0</Weight>
|
166
|
+
</BillingWeight>
|
167
|
+
<TransportationCharges>
|
168
|
+
<CurrencyCode>USD</CurrencyCode>
|
169
|
+
<MonetaryValue>66.92</MonetaryValue>
|
170
|
+
</TransportationCharges>
|
171
|
+
<ServiceOptionsCharges>
|
172
|
+
<CurrencyCode>USD</CurrencyCode>
|
173
|
+
<MonetaryValue>0.00</MonetaryValue>
|
174
|
+
</ServiceOptionsCharges>
|
175
|
+
<TotalCharges>
|
176
|
+
<CurrencyCode>USD</CurrencyCode>
|
177
|
+
<MonetaryValue>66.92</MonetaryValue>
|
178
|
+
</TotalCharges>
|
179
|
+
<GuaranteedDaysToDelivery>1</GuaranteedDaysToDelivery>
|
180
|
+
<ScheduledDeliveryTime>2:00 P.M.</ScheduledDeliveryTime>
|
181
|
+
<RatedPackage>
|
182
|
+
<TransportationCharges>
|
183
|
+
<CurrencyCode>USD</CurrencyCode>
|
184
|
+
<MonetaryValue>66.92</MonetaryValue>
|
185
|
+
</TransportationCharges>
|
186
|
+
<ServiceOptionsCharges>
|
187
|
+
<CurrencyCode>USD</CurrencyCode>
|
188
|
+
<MonetaryValue>0.00</MonetaryValue>
|
189
|
+
</ServiceOptionsCharges>
|
190
|
+
<TotalCharges>
|
191
|
+
<CurrencyCode>USD</CurrencyCode>
|
192
|
+
<MonetaryValue>66.92</MonetaryValue>
|
193
|
+
</TotalCharges>
|
194
|
+
<Weight>2.7</Weight>
|
195
|
+
<BillingWeight>
|
196
|
+
<UnitOfMeasurement>
|
197
|
+
<Code>LBS</Code>
|
198
|
+
</UnitOfMeasurement>
|
199
|
+
<Weight>4.0</Weight>
|
200
|
+
</BillingWeight>
|
201
|
+
</RatedPackage>
|
202
|
+
</RatedShipment>
|
203
|
+
<RatedShipment>
|
204
|
+
<Service>
|
205
|
+
<Code>01</Code>
|
206
|
+
</Service>
|
207
|
+
<RatedShipmentWarning>User Id and Shipper Number combination is not qualified to receive negotiated rates.</RatedShipmentWarning>
|
208
|
+
<RatedShipmentWarning>Your invoice may vary from the displayed reference rates</RatedShipmentWarning>
|
209
|
+
<RatedShipmentWarning>Ship To Address Classification is changed from Residential to Commercial</RatedShipmentWarning>
|
210
|
+
<BillingWeight>
|
211
|
+
<UnitOfMeasurement>
|
212
|
+
<Code>LBS</Code>
|
213
|
+
</UnitOfMeasurement>
|
214
|
+
<Weight>4.0</Weight>
|
215
|
+
</BillingWeight>
|
216
|
+
<TransportationCharges>
|
217
|
+
<CurrencyCode>USD</CurrencyCode>
|
218
|
+
<MonetaryValue>35.72</MonetaryValue>
|
219
|
+
</TransportationCharges>
|
220
|
+
<ServiceOptionsCharges>
|
221
|
+
<CurrencyCode>USD</CurrencyCode>
|
222
|
+
<MonetaryValue>0.00</MonetaryValue>
|
223
|
+
</ServiceOptionsCharges>
|
224
|
+
<TotalCharges>
|
225
|
+
<CurrencyCode>USD</CurrencyCode>
|
226
|
+
<MonetaryValue>35.72</MonetaryValue>
|
227
|
+
</TotalCharges>
|
228
|
+
<GuaranteedDaysToDelivery>1</GuaranteedDaysToDelivery>
|
229
|
+
<ScheduledDeliveryTime/>
|
230
|
+
<RatedPackage>
|
231
|
+
<TransportationCharges>
|
232
|
+
<CurrencyCode>USD</CurrencyCode>
|
233
|
+
<MonetaryValue>35.72</MonetaryValue>
|
234
|
+
</TransportationCharges>
|
235
|
+
<ServiceOptionsCharges>
|
236
|
+
<CurrencyCode>USD</CurrencyCode>
|
237
|
+
<MonetaryValue>0.00</MonetaryValue>
|
238
|
+
</ServiceOptionsCharges>
|
239
|
+
<TotalCharges>
|
240
|
+
<CurrencyCode>USD</CurrencyCode>
|
241
|
+
<MonetaryValue>35.72</MonetaryValue>
|
242
|
+
</TotalCharges>
|
243
|
+
<Weight>2.7</Weight>
|
244
|
+
<BillingWeight>
|
245
|
+
<UnitOfMeasurement>
|
246
|
+
<Code>LBS</Code>
|
247
|
+
</UnitOfMeasurement>
|
248
|
+
<Weight>4.0</Weight>
|
249
|
+
</BillingWeight>
|
250
|
+
</RatedPackage>
|
251
|
+
</RatedShipment>
|
252
|
+
</RatingServiceSelectionResponse>
|
253
|
+
|
@@ -0,0 +1,237 @@
|
|
1
|
+
<?xml version="1.0" ?>
|
2
|
+
<RatingServiceSelectionResponse>
|
3
|
+
<Response>
|
4
|
+
<ResponseStatusCode>1</ResponseStatusCode>
|
5
|
+
<ResponseStatusDescription>Success</ResponseStatusDescription>
|
6
|
+
</Response>
|
7
|
+
<RatedShipment>
|
8
|
+
<Service>
|
9
|
+
<Code>03</Code>
|
10
|
+
</Service>
|
11
|
+
<BillingWeight>
|
12
|
+
<UnitOfMeasurement>
|
13
|
+
<Code>LBS</Code>
|
14
|
+
</UnitOfMeasurement>
|
15
|
+
<Weight>4.0</Weight>
|
16
|
+
</BillingWeight>
|
17
|
+
<TransportationCharges>
|
18
|
+
<CurrencyCode>USD</CurrencyCode>
|
19
|
+
<MonetaryValue>10.85</MonetaryValue>
|
20
|
+
</TransportationCharges>
|
21
|
+
<ServiceOptionsCharges>
|
22
|
+
<CurrencyCode>USD</CurrencyCode>
|
23
|
+
<MonetaryValue>0.00</MonetaryValue>
|
24
|
+
</ServiceOptionsCharges>
|
25
|
+
<TotalCharges>
|
26
|
+
<CurrencyCode>USD</CurrencyCode>
|
27
|
+
<MonetaryValue>10.85</MonetaryValue>
|
28
|
+
</TotalCharges>
|
29
|
+
<GuaranteedDaysToDelivery/>
|
30
|
+
<ScheduledDeliveryTime/>
|
31
|
+
<RatedPackage>
|
32
|
+
<TransportationCharges>
|
33
|
+
<CurrencyCode>USD</CurrencyCode>
|
34
|
+
<MonetaryValue>10.85</MonetaryValue>
|
35
|
+
</TransportationCharges>
|
36
|
+
<ServiceOptionsCharges>
|
37
|
+
<CurrencyCode>USD</CurrencyCode>
|
38
|
+
<MonetaryValue>0.00</MonetaryValue>
|
39
|
+
</ServiceOptionsCharges>
|
40
|
+
<TotalCharges>
|
41
|
+
<CurrencyCode>USD</CurrencyCode>
|
42
|
+
<MonetaryValue>10.85</MonetaryValue>
|
43
|
+
</TotalCharges>
|
44
|
+
<Weight>2.7</Weight>
|
45
|
+
<BillingWeight>
|
46
|
+
<UnitOfMeasurement>
|
47
|
+
<Code>LBS</Code>
|
48
|
+
</UnitOfMeasurement>
|
49
|
+
<Weight>4.0</Weight>
|
50
|
+
</BillingWeight>
|
51
|
+
</RatedPackage>
|
52
|
+
</RatedShipment>
|
53
|
+
<RatedShipment>
|
54
|
+
<Service>
|
55
|
+
<Code>12</Code>
|
56
|
+
</Service>
|
57
|
+
<BillingWeight>
|
58
|
+
<UnitOfMeasurement>
|
59
|
+
<Code>LBS</Code>
|
60
|
+
</UnitOfMeasurement>
|
61
|
+
<Weight>4.0</Weight>
|
62
|
+
</BillingWeight>
|
63
|
+
<TransportationCharges>
|
64
|
+
<CurrencyCode>USD</CurrencyCode>
|
65
|
+
<MonetaryValue>14.56</MonetaryValue>
|
66
|
+
</TransportationCharges>
|
67
|
+
<ServiceOptionsCharges>
|
68
|
+
<CurrencyCode>USD</CurrencyCode>
|
69
|
+
<MonetaryValue>0.00</MonetaryValue>
|
70
|
+
</ServiceOptionsCharges>
|
71
|
+
<TotalCharges>
|
72
|
+
<CurrencyCode>USD</CurrencyCode>
|
73
|
+
<MonetaryValue>14.56</MonetaryValue>
|
74
|
+
</TotalCharges>
|
75
|
+
<GuaranteedDaysToDelivery>3</GuaranteedDaysToDelivery>
|
76
|
+
<ScheduledDeliveryTime/>
|
77
|
+
<RatedPackage>
|
78
|
+
<TransportationCharges>
|
79
|
+
<CurrencyCode>USD</CurrencyCode>
|
80
|
+
<MonetaryValue>14.56</MonetaryValue>
|
81
|
+
</TransportationCharges>
|
82
|
+
<ServiceOptionsCharges>
|
83
|
+
<CurrencyCode>USD</CurrencyCode>
|
84
|
+
<MonetaryValue>0.00</MonetaryValue>
|
85
|
+
</ServiceOptionsCharges>
|
86
|
+
<TotalCharges>
|
87
|
+
<CurrencyCode>USD</CurrencyCode>
|
88
|
+
<MonetaryValue>14.56</MonetaryValue>
|
89
|
+
</TotalCharges>
|
90
|
+
<Weight>2.7</Weight>
|
91
|
+
<BillingWeight>
|
92
|
+
<UnitOfMeasurement>
|
93
|
+
<Code>LBS</Code>
|
94
|
+
</UnitOfMeasurement>
|
95
|
+
<Weight>4.0</Weight>
|
96
|
+
</BillingWeight>
|
97
|
+
</RatedPackage>
|
98
|
+
</RatedShipment>
|
99
|
+
<RatedShipment>
|
100
|
+
<Service>
|
101
|
+
<Code>02</Code>
|
102
|
+
</Service>
|
103
|
+
<BillingWeight>
|
104
|
+
<UnitOfMeasurement>
|
105
|
+
<Code>LBS</Code>
|
106
|
+
</UnitOfMeasurement>
|
107
|
+
<Weight>4.0</Weight>
|
108
|
+
</BillingWeight>
|
109
|
+
<TransportationCharges>
|
110
|
+
<CurrencyCode>USD</CurrencyCode>
|
111
|
+
<MonetaryValue>19.94</MonetaryValue>
|
112
|
+
</TransportationCharges>
|
113
|
+
<ServiceOptionsCharges>
|
114
|
+
<CurrencyCode>USD</CurrencyCode>
|
115
|
+
<MonetaryValue>0.00</MonetaryValue>
|
116
|
+
</ServiceOptionsCharges>
|
117
|
+
<TotalCharges>
|
118
|
+
<CurrencyCode>USD</CurrencyCode>
|
119
|
+
<MonetaryValue>19.94</MonetaryValue>
|
120
|
+
</TotalCharges>
|
121
|
+
<GuaranteedDaysToDelivery>2</GuaranteedDaysToDelivery>
|
122
|
+
<ScheduledDeliveryTime/>
|
123
|
+
<RatedPackage>
|
124
|
+
<TransportationCharges>
|
125
|
+
<CurrencyCode>USD</CurrencyCode>
|
126
|
+
<MonetaryValue>19.94</MonetaryValue>
|
127
|
+
</TransportationCharges>
|
128
|
+
<ServiceOptionsCharges>
|
129
|
+
<CurrencyCode>USD</CurrencyCode>
|
130
|
+
<MonetaryValue>0.00</MonetaryValue>
|
131
|
+
</ServiceOptionsCharges>
|
132
|
+
<TotalCharges>
|
133
|
+
<CurrencyCode>USD</CurrencyCode>
|
134
|
+
<MonetaryValue>19.94</MonetaryValue>
|
135
|
+
</TotalCharges>
|
136
|
+
<Weight>2.7</Weight>
|
137
|
+
<BillingWeight>
|
138
|
+
<UnitOfMeasurement>
|
139
|
+
<Code>LBS</Code>
|
140
|
+
</UnitOfMeasurement>
|
141
|
+
<Weight>4.0</Weight>
|
142
|
+
</BillingWeight>
|
143
|
+
</RatedPackage>
|
144
|
+
</RatedShipment>
|
145
|
+
<RatedShipment>
|
146
|
+
<Service>
|
147
|
+
<Code>14</Code>
|
148
|
+
</Service>
|
149
|
+
<BillingWeight>
|
150
|
+
<UnitOfMeasurement>
|
151
|
+
<Code>LBS</Code>
|
152
|
+
</UnitOfMeasurement>
|
153
|
+
<Weight>4.0</Weight>
|
154
|
+
</BillingWeight>
|
155
|
+
<TransportationCharges>
|
156
|
+
<CurrencyCode>USD</CurrencyCode>
|
157
|
+
<MonetaryValue>66.92</MonetaryValue>
|
158
|
+
</TransportationCharges>
|
159
|
+
<ServiceOptionsCharges>
|
160
|
+
<CurrencyCode>USD</CurrencyCode>
|
161
|
+
<MonetaryValue>0.00</MonetaryValue>
|
162
|
+
</ServiceOptionsCharges>
|
163
|
+
<TotalCharges>
|
164
|
+
<CurrencyCode>USD</CurrencyCode>
|
165
|
+
<MonetaryValue>66.92</MonetaryValue>
|
166
|
+
</TotalCharges>
|
167
|
+
<GuaranteedDaysToDelivery>1</GuaranteedDaysToDelivery>
|
168
|
+
<ScheduledDeliveryTime>2:00 P.M.</ScheduledDeliveryTime>
|
169
|
+
<RatedPackage>
|
170
|
+
<TransportationCharges>
|
171
|
+
<CurrencyCode>USD</CurrencyCode>
|
172
|
+
<MonetaryValue>66.92</MonetaryValue>
|
173
|
+
</TransportationCharges>
|
174
|
+
<ServiceOptionsCharges>
|
175
|
+
<CurrencyCode>USD</CurrencyCode>
|
176
|
+
<MonetaryValue>0.00</MonetaryValue>
|
177
|
+
</ServiceOptionsCharges>
|
178
|
+
<TotalCharges>
|
179
|
+
<CurrencyCode>USD</CurrencyCode>
|
180
|
+
<MonetaryValue>66.92</MonetaryValue>
|
181
|
+
</TotalCharges>
|
182
|
+
<Weight>2.7</Weight>
|
183
|
+
<BillingWeight>
|
184
|
+
<UnitOfMeasurement>
|
185
|
+
<Code>LBS</Code>
|
186
|
+
</UnitOfMeasurement>
|
187
|
+
<Weight>4.0</Weight>
|
188
|
+
</BillingWeight>
|
189
|
+
</RatedPackage>
|
190
|
+
</RatedShipment>
|
191
|
+
<RatedShipment>
|
192
|
+
<Service>
|
193
|
+
<Code>01</Code>
|
194
|
+
</Service>
|
195
|
+
<BillingWeight>
|
196
|
+
<UnitOfMeasurement>
|
197
|
+
<Code>LBS</Code>
|
198
|
+
</UnitOfMeasurement>
|
199
|
+
<Weight>4.0</Weight>
|
200
|
+
</BillingWeight>
|
201
|
+
<TransportationCharges>
|
202
|
+
<CurrencyCode>USD</CurrencyCode>
|
203
|
+
<MonetaryValue>35.72</MonetaryValue>
|
204
|
+
</TransportationCharges>
|
205
|
+
<ServiceOptionsCharges>
|
206
|
+
<CurrencyCode>USD</CurrencyCode>
|
207
|
+
<MonetaryValue>0.00</MonetaryValue>
|
208
|
+
</ServiceOptionsCharges>
|
209
|
+
<TotalCharges>
|
210
|
+
<CurrencyCode>USD</CurrencyCode>
|
211
|
+
<MonetaryValue>35.72</MonetaryValue>
|
212
|
+
</TotalCharges>
|
213
|
+
<GuaranteedDaysToDelivery>1</GuaranteedDaysToDelivery>
|
214
|
+
<ScheduledDeliveryTime/>
|
215
|
+
<RatedPackage>
|
216
|
+
<TransportationCharges>
|
217
|
+
<CurrencyCode>USD</CurrencyCode>
|
218
|
+
<MonetaryValue>35.72</MonetaryValue>
|
219
|
+
</TransportationCharges>
|
220
|
+
<ServiceOptionsCharges>
|
221
|
+
<CurrencyCode>USD</CurrencyCode>
|
222
|
+
<MonetaryValue>0.00</MonetaryValue>
|
223
|
+
</ServiceOptionsCharges>
|
224
|
+
<TotalCharges>
|
225
|
+
<CurrencyCode>USD</CurrencyCode>
|
226
|
+
<MonetaryValue>35.72</MonetaryValue>
|
227
|
+
</TotalCharges>
|
228
|
+
<Weight>2.7</Weight>
|
229
|
+
<BillingWeight>
|
230
|
+
<UnitOfMeasurement>
|
231
|
+
<Code>LBS</Code>
|
232
|
+
</UnitOfMeasurement>
|
233
|
+
<Weight>4.0</Weight>
|
234
|
+
</BillingWeight>
|
235
|
+
</RatedPackage>
|
236
|
+
</RatedShipment>
|
237
|
+
</RatingServiceSelectionResponse>
|
@@ -186,6 +186,31 @@ class UPSTest < Minitest::Test
|
|
186
186
|
assert_equal "Failure: Package exceeds the maximum length constraint of 108 inches. Length is the longest side of a package.", e.message
|
187
187
|
end
|
188
188
|
|
189
|
+
def test_handles_no_shipment_warning_messages
|
190
|
+
mock_response = xml_fixture('ups/no_shipment_warnings')
|
191
|
+
@carrier.expects(:commit).returns(mock_response)
|
192
|
+
response = @carrier.find_rates(location_fixtures[:beverly_hills],
|
193
|
+
location_fixtures[:real_home_as_residential],
|
194
|
+
package_fixtures.values_at(:chocolate_stuff))
|
195
|
+
rate = response.rates.first
|
196
|
+
assert_equal [], rate.messages
|
197
|
+
end
|
198
|
+
|
199
|
+
def test_handles_warning_messages
|
200
|
+
mock_response = xml_fixture('ups/no_negotiated_rates')
|
201
|
+
@carrier.expects(:commit).returns(mock_response)
|
202
|
+
response = @carrier.find_rates(location_fixtures[:beverly_hills],
|
203
|
+
location_fixtures[:real_home_as_residential],
|
204
|
+
package_fixtures.values_at(:chocolate_stuff))
|
205
|
+
rate = response.rates.first
|
206
|
+
expected_messages = [
|
207
|
+
"User Id and Shipper Number combination is not qualified to receive negotiated rates.",
|
208
|
+
"Your invoice may vary from the displayed reference rates",
|
209
|
+
"Ship To Address Classification is changed from Residential to Commercial"
|
210
|
+
]
|
211
|
+
assert_equal expected_messages, rate.messages
|
212
|
+
end
|
213
|
+
|
189
214
|
def test_response_parsing_an_undecoded_character
|
190
215
|
unencoded_response = @tracking_response.gsub('NAPERVILLE', "N\xc4PERVILLE")
|
191
216
|
@carrier.stubs(:ssl_post).returns(unencoded_response)
|
@@ -89,4 +89,9 @@ class RateEstimateTest < Minitest::Test
|
|
89
89
|
assert_equal [DateTime.parse("Fri 01 Jul 2016"), DateTime.parse("Sun 03 Jul 2016")], @rate_estimate.delivery_range
|
90
90
|
assert_equal DateTime.parse("Sun 03 Jul 2016"), @rate_estimate.delivery_date
|
91
91
|
end
|
92
|
+
|
93
|
+
def test_messages_is_set
|
94
|
+
rate = RateEstimate.new(@origin, @destination, @carrier, @service_name, @options.merge(messages: ["warning"]))
|
95
|
+
assert_equal ["warning"], rate.messages
|
96
|
+
end
|
92
97
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_shipping
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
@@ -333,6 +333,8 @@ files:
|
|
333
333
|
- test/fixtures/xml/ups/delivery_dates_response.xml
|
334
334
|
- test/fixtures/xml/ups/example_tracking_response.xml
|
335
335
|
- test/fixtures/xml/ups/in_transit_shipment.xml
|
336
|
+
- test/fixtures/xml/ups/no_negotiated_rates.xml
|
337
|
+
- test/fixtures/xml/ups/no_shipment_warnings.xml
|
336
338
|
- test/fixtures/xml/ups/no_status_node_success.xml
|
337
339
|
- test/fixtures/xml/ups/out_for_delivery_shipment.xml
|
338
340
|
- test/fixtures/xml/ups/package_exceeds_maximum_length.xml
|
@@ -557,6 +559,8 @@ test_files:
|
|
557
559
|
- test/fixtures/xml/ups/delivery_dates_response.xml
|
558
560
|
- test/fixtures/xml/ups/example_tracking_response.xml
|
559
561
|
- test/fixtures/xml/ups/in_transit_shipment.xml
|
562
|
+
- test/fixtures/xml/ups/no_negotiated_rates.xml
|
563
|
+
- test/fixtures/xml/ups/no_shipment_warnings.xml
|
560
564
|
- test/fixtures/xml/ups/no_status_node_success.xml
|
561
565
|
- test/fixtures/xml/ups/out_for_delivery_shipment.xml
|
562
566
|
- test/fixtures/xml/ups/package_exceeds_maximum_length.xml
|