ups-ruby 0.15.0 → 0.16.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 98eb4d0e532a9f1d70550ad5657b73365d2ae70e4d98611fdaaade27f391dbe8
4
- data.tar.gz: a732b68cc271d6f0961ad0bb42b34d4f616f2ebbe0724d04da0b2fb3130deade
3
+ metadata.gz: 481f7937c68f91e543b6f5184e402e0ebfab6a6dbfcdf62d793002bbeaef1055
4
+ data.tar.gz: da94a933847ee5bd730690405c82363096e3c72341de002bd3ab06082223a432
5
5
  SHA512:
6
- metadata.gz: 72295e8a50e1f056894dbcb2e8e00d92a56f49f920d7fcb17ef22fba9fec4282c6141dea5948a9cf051026fa343e6c2e7126fd14c1f37c7c71543589a658acf4
7
- data.tar.gz: 1abc90c0d00eb9c6421576a1e41b2f7bc60002a865a3135b8889ba29ab86452c6cb23d6d1ea2428d541c06485239693bf08a1a15a090bb4002fda9a29a83886c
6
+ metadata.gz: e6832c9af4bc93c8c412f32e390bdfa57a3589ba233360b76bf3a4c3a43517565e3c96431f661f01d7008d660fe30c02ec1ac0bdbf7e7a615b33de2daeb31260
7
+ data.tar.gz: a03cd1a4f46634c4a291be29542d0552a9289735e571ca776c060893ed3b97360e4bdc370bb11fd2f3e57cb5d428c129d3142d950b9b42c6b85ed8b77e3c2555
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ups-ruby (0.15.0)
4
+ ups-ruby (0.16.0)
5
5
  excon (~> 0.45, >= 0.45.3)
6
6
  insensitive_hash (~> 0.3.3)
7
7
  levenshtein-ffi (~> 1.1)
@@ -13,8 +13,8 @@ GEM
13
13
  codeclimate-test-reporter (1.0.5)
14
14
  simplecov
15
15
  docile (1.1.5)
16
- excon (0.69.1)
17
- ffi (1.11.3)
16
+ excon (0.73.0)
17
+ ffi (1.12.2)
18
18
  insensitive_hash (0.3.3)
19
19
  json (1.8.6)
20
20
  levenshtein-ffi (1.1.0)
@@ -23,7 +23,7 @@ GEM
23
23
  minitest (5.7.0)
24
24
  nokogiri (1.10.3)
25
25
  mini_portile2 (~> 2.4.0)
26
- ox (2.11.0)
26
+ ox (2.13.2)
27
27
  rake (12.0.0)
28
28
  simplecov (0.10.0)
29
29
  docile (~> 1.1.0)
@@ -144,13 +144,17 @@ module UPS
144
144
  # @return [void]
145
145
  def add_package(opts = {})
146
146
  shipment_root << Element.new('Package').tap do |org|
147
- org << packaging_type
147
+ org << packaging_type(opts[:packaging_type] || customer_supplied_packaging)
148
148
  org << element_with_value('Description', 'Rate')
149
149
  org << package_weight(opts[:weight], opts[:unit])
150
150
  org << package_dimensions(opts[:dimensions]) if opts[:dimensions]
151
151
  end
152
152
  end
153
153
 
154
+ def customer_supplied_packaging
155
+ {code: '02', description: 'Customer Supplied Package'}
156
+ end
157
+
154
158
  # Adds a PaymentInformation section to the XML document being built
155
159
  #
156
160
  # @param [String] ship_number The UPS Shipper Number
@@ -218,8 +222,8 @@ module UPS
218
222
  end
219
223
  end
220
224
 
221
- def packaging_type
222
- code_description 'PackagingType', '02', 'Customer Supplied'
225
+ def packaging_type(packaging_options_hash)
226
+ code_description 'PackagingType', packaging_options_hash[:code], packaging_options_hash[:description]
223
227
  end
224
228
 
225
229
  def package_weight(weight, unit)
@@ -54,6 +54,10 @@ module UPS
54
54
  service_description)
55
55
  end
56
56
 
57
+ def add_invoice_line_total(value, currency_code)
58
+ shipment_root << invoice_line_total(value, currency_code)
59
+ end
60
+
57
61
  # Adds Description to XML document being built
58
62
  #
59
63
  # @param [String] description The description for goods being sent
@@ -107,6 +111,12 @@ module UPS
107
111
  'Code' => code.to_s,
108
112
  'Value' => value.to_s)
109
113
  end
114
+
115
+ def invoice_line_total(value, currency_code)
116
+ multi_valued('InvoiceLineTotal',
117
+ 'CurrencyCode' => currency_code.to_s,
118
+ 'MonetaryValue' => value.to_s)
119
+ end
110
120
  end
111
121
  end
112
122
  end
@@ -1,7 +1,7 @@
1
1
  module UPS
2
2
  module Version
3
3
  MAJOR = 0
4
- MINOR = 15
4
+ MINOR = 16
5
5
  PATCH = 0
6
6
  BUILD = nil
7
7
 
@@ -0,0 +1,187 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <RatingServiceSelectionResponse>
3
+ <Response>
4
+ <ResponseStatusCode>1</ResponseStatusCode>
5
+ <ResponseStatusDescription>Success</ResponseStatusDescription>
6
+ </Response>
7
+ <RatedShipment>
8
+ <Service>
9
+ <Code>07</Code>
10
+ </Service>
11
+ <RatedShipmentWarning>
12
+ The weight exceeds the limit for the UPS Letter/Envelope rate and will be rated using the weight.
13
+ </RatedShipmentWarning>
14
+ <RatedShipmentWarning>
15
+ Your invoice may vary from the displayed reference rates
16
+ </RatedShipmentWarning>
17
+ <BillingWeight>
18
+ <UnitOfMeasurement>
19
+ <Code>KGS</Code>
20
+ </UnitOfMeasurement>
21
+ <Weight>8.0</Weight>
22
+ </BillingWeight>
23
+ <TransportationCharges>
24
+ <CurrencyCode>GBP</CurrencyCode>
25
+ <MonetaryValue>172.77</MonetaryValue>
26
+ </TransportationCharges>
27
+ <ServiceOptionsCharges>
28
+ <CurrencyCode>GBP</CurrencyCode>
29
+ <MonetaryValue>0.00</MonetaryValue>
30
+ </ServiceOptionsCharges>
31
+ <TotalCharges>
32
+ <CurrencyCode>GBP</CurrencyCode>
33
+ <MonetaryValue>172.77</MonetaryValue>
34
+ </TotalCharges>
35
+ <GuaranteedDaysToDelivery/>
36
+ <ScheduledDeliveryTime/>
37
+ <RatedPackage>
38
+ <TransportationCharges>
39
+ <CurrencyCode/>
40
+ <MonetaryValue/>
41
+ </TransportationCharges>
42
+ <ServiceOptionsCharges>
43
+ <CurrencyCode/>
44
+ <MonetaryValue/>
45
+ </ServiceOptionsCharges>
46
+ <TotalCharges>
47
+ <CurrencyCode/>
48
+ <MonetaryValue/>
49
+ </TotalCharges>
50
+ <Weight>8.0</Weight>
51
+ <BillingWeight>
52
+ <UnitOfMeasurement>
53
+ <Code/>
54
+ </UnitOfMeasurement>
55
+ <Weight/>
56
+ </BillingWeight>
57
+ </RatedPackage>
58
+ <NegotiatedRates>
59
+ <NetSummaryCharges>
60
+ <GrandTotal>
61
+ <CurrencyCode>GBP</CurrencyCode>
62
+ <MonetaryValue>171.04</MonetaryValue>
63
+ </GrandTotal>
64
+ </NetSummaryCharges>
65
+ </NegotiatedRates>
66
+ </RatedShipment>
67
+ <RatedShipment>
68
+ <Service>
69
+ <Code>65</Code>
70
+ </Service>
71
+ <RatedShipmentWarning>
72
+ The weight exceeds the limit for the UPS Letter/Envelope rate and will be rated using the weight.
73
+ </RatedShipmentWarning>
74
+ <RatedShipmentWarning>
75
+ Your invoice may vary from the displayed reference rates
76
+ </RatedShipmentWarning>
77
+ <BillingWeight>
78
+ <UnitOfMeasurement>
79
+ <Code>KGS</Code>
80
+ </UnitOfMeasurement>
81
+ <Weight>8.0</Weight>
82
+ </BillingWeight>
83
+ <TransportationCharges>
84
+ <CurrencyCode>GBP</CurrencyCode>
85
+ <MonetaryValue>162.38</MonetaryValue>
86
+ </TransportationCharges>
87
+ <ServiceOptionsCharges>
88
+ <CurrencyCode>GBP</CurrencyCode>
89
+ <MonetaryValue>0.00</MonetaryValue>
90
+ </ServiceOptionsCharges>
91
+ <TotalCharges>
92
+ <CurrencyCode>GBP</CurrencyCode>
93
+ <MonetaryValue>162.38</MonetaryValue>
94
+ </TotalCharges>
95
+ <GuaranteedDaysToDelivery/>
96
+ <ScheduledDeliveryTime/>
97
+ <RatedPackage>
98
+ <TransportationCharges>
99
+ <CurrencyCode/>
100
+ <MonetaryValue/>
101
+ </TransportationCharges>
102
+ <ServiceOptionsCharges>
103
+ <CurrencyCode/>
104
+ <MonetaryValue/>
105
+ </ServiceOptionsCharges>
106
+ <TotalCharges>
107
+ <CurrencyCode/>
108
+ <MonetaryValue/>
109
+ </TotalCharges>
110
+ <Weight>8.0</Weight>
111
+ <BillingWeight>
112
+ <UnitOfMeasurement>
113
+ <Code/>
114
+ </UnitOfMeasurement>
115
+ <Weight/>
116
+ </BillingWeight>
117
+ </RatedPackage>
118
+ <NegotiatedRates>
119
+ <NetSummaryCharges>
120
+ <GrandTotal>
121
+ <CurrencyCode>GBP</CurrencyCode>
122
+ <MonetaryValue>160.76</MonetaryValue>
123
+ </GrandTotal>
124
+ </NetSummaryCharges>
125
+ </NegotiatedRates>
126
+ </RatedShipment>
127
+ <RatedShipment>
128
+ <Service>
129
+ <Code>54</Code>
130
+ </Service>
131
+ <RatedShipmentWarning>
132
+ The weight exceeds the limit for the UPS Letter/Envelope rate and will be rated using the weight.
133
+ </RatedShipmentWarning>
134
+ <RatedShipmentWarning>
135
+ Your invoice may vary from the displayed reference rates
136
+ </RatedShipmentWarning>
137
+ <BillingWeight>
138
+ <UnitOfMeasurement>
139
+ <Code>KGS</Code>
140
+ </UnitOfMeasurement>
141
+ <Weight>8.0</Weight>
142
+ </BillingWeight>
143
+ <TransportationCharges>
144
+ <CurrencyCode>GBP</CurrencyCode>
145
+ <MonetaryValue>229.18</MonetaryValue>
146
+ </TransportationCharges>
147
+ <ServiceOptionsCharges>
148
+ <CurrencyCode>GBP</CurrencyCode>
149
+ <MonetaryValue>0.00</MonetaryValue>
150
+ </ServiceOptionsCharges>
151
+ <TotalCharges>
152
+ <CurrencyCode>GBP</CurrencyCode>
153
+ <MonetaryValue>229.18</MonetaryValue>
154
+ </TotalCharges>
155
+ <GuaranteedDaysToDelivery/>
156
+ <ScheduledDeliveryTime/>
157
+ <RatedPackage>
158
+ <TransportationCharges>
159
+ <CurrencyCode/>
160
+ <MonetaryValue/>
161
+ </TransportationCharges>
162
+ <ServiceOptionsCharges>
163
+ <CurrencyCode/>
164
+ <MonetaryValue/>
165
+ </ServiceOptionsCharges>
166
+ <TotalCharges>
167
+ <CurrencyCode/>
168
+ <MonetaryValue/>
169
+ </TotalCharges>
170
+ <Weight>8.0</Weight>
171
+ <BillingWeight>
172
+ <UnitOfMeasurement>
173
+ <Code/>
174
+ </UnitOfMeasurement>
175
+ <Weight/>
176
+ </BillingWeight>
177
+ </RatedPackage>
178
+ <NegotiatedRates>
179
+ <NetSummaryCharges>
180
+ <GrandTotal>
181
+ <CurrencyCode>GBP</CurrencyCode>
182
+ <MonetaryValue>226.89</MonetaryValue>
183
+ </GrandTotal>
184
+ </NetSummaryCharges>
185
+ </NegotiatedRates>
186
+ </RatedShipment>
187
+ </RatingServiceSelectionResponse>
@@ -0,0 +1,185 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <RatingServiceSelectionResponse>
3
+ <Response>
4
+ <ResponseStatusCode>1</ResponseStatusCode>
5
+ <ResponseStatusDescription>Success</ResponseStatusDescription>
6
+ </Response>
7
+ <RatedShipment>
8
+ <Service>
9
+ <Code>07</Code>
10
+ </Service>
11
+ <RatedShipmentWarning>
12
+ The weight exceeds the limit for the UPS Letter/Envelope rate and will be rated using the weight.
13
+ </RatedShipmentWarning>
14
+ <RatedShipmentWarning>
15
+ Your invoice may vary from the displayed reference rates
16
+ </RatedShipmentWarning>
17
+ <BillingWeight>
18
+ <UnitOfMeasurement>
19
+ <Code>KGS</Code>
20
+ </UnitOfMeasurement>
21
+ <Weight>8.0</Weight>
22
+ </BillingWeight>
23
+ <TransportationCharges>
24
+ <CurrencyCode>GBP</CurrencyCode>
25
+ <MonetaryValue>171.99</MonetaryValue>
26
+ </TransportationCharges>
27
+ <ServiceOptionsCharges>
28
+ <CurrencyCode>GBP</CurrencyCode>
29
+ <MonetaryValue>0.00</MonetaryValue>
30
+ </ServiceOptionsCharges>
31
+ <TotalCharges>
32
+ <CurrencyCode>GBP</CurrencyCode>
33
+ <MonetaryValue>171.99</MonetaryValue>
34
+ </TotalCharges><GuaranteedDaysToDelivery/>
35
+ <ScheduledDeliveryTime/>
36
+ <RatedPackage>
37
+ <TransportationCharges>
38
+ <CurrencyCode/>
39
+ <MonetaryValue/>
40
+ </TransportationCharges>
41
+ <ServiceOptionsCharges>
42
+ <CurrencyCode/>
43
+ <MonetaryValue/>
44
+ </ServiceOptionsCharges>
45
+ <TotalCharges>
46
+ <CurrencyCode/>
47
+ <MonetaryValue/>
48
+ </TotalCharges>
49
+ <Weight>8.0</Weight>
50
+ <BillingWeight>
51
+ <UnitOfMeasurement>
52
+ <Code/>
53
+ </UnitOfMeasurement>
54
+ <Weight/>
55
+ </BillingWeight>
56
+ </RatedPackage>
57
+ <NegotiatedRates>
58
+ <NetSummaryCharges>
59
+ <GrandTotal>
60
+ <CurrencyCode>GBP</CurrencyCode>
61
+ <MonetaryValue>170.27</MonetaryValue>
62
+ </GrandTotal>
63
+ </NetSummaryCharges>
64
+ </NegotiatedRates>
65
+ </RatedShipment>
66
+ <RatedShipment>
67
+ <Service>
68
+ <Code>65</Code>
69
+ </Service>
70
+ <RatedShipmentWarning>
71
+ The weight exceeds the limit for the UPS Letter/Envelope rate and will be rated using the weight.
72
+ </RatedShipmentWarning>
73
+ <RatedShipmentWarning>
74
+ Your invoice may vary from the displayed reference rates
75
+ </RatedShipmentWarning>
76
+ <BillingWeight>
77
+ <UnitOfMeasurement>
78
+ <Code>KGS</Code>
79
+ </UnitOfMeasurement>
80
+ <Weight>8.0</Weight>
81
+ </BillingWeight>
82
+ <TransportationCharges>
83
+ <CurrencyCode>GBP</CurrencyCode>
84
+ <MonetaryValue>162.38</MonetaryValue>
85
+ </TransportationCharges>
86
+ <ServiceOptionsCharges>
87
+ <CurrencyCode>GBP</CurrencyCode>
88
+ <MonetaryValue>0.00</MonetaryValue>
89
+ </ServiceOptionsCharges>
90
+ <TotalCharges>
91
+ <CurrencyCode>GBP</CurrencyCode>
92
+ <MonetaryValue>162.38</MonetaryValue>
93
+ </TotalCharges>
94
+ <GuaranteedDaysToDelivery/>
95
+ <ScheduledDeliveryTime/>
96
+ <RatedPackage>
97
+ <TransportationCharges>
98
+ <CurrencyCode/>
99
+ <MonetaryValue/>
100
+ </TransportationCharges>
101
+ <ServiceOptionsCharges>
102
+ <CurrencyCode/>
103
+ <MonetaryValue/>
104
+ </ServiceOptionsCharges>
105
+ <TotalCharges>
106
+ <CurrencyCode/>
107
+ <MonetaryValue/>
108
+ </TotalCharges>
109
+ <Weight>8.0</Weight>
110
+ <BillingWeight>
111
+ <UnitOfMeasurement>
112
+ <Code/>
113
+ </UnitOfMeasurement>
114
+ <Weight/>
115
+ </BillingWeight>
116
+ </RatedPackage>
117
+ <NegotiatedRates>
118
+ <NetSummaryCharges>
119
+ <GrandTotal>
120
+ <CurrencyCode>GBP</CurrencyCode>
121
+ <MonetaryValue>160.76</MonetaryValue>
122
+ </GrandTotal>
123
+ </NetSummaryCharges>
124
+ </NegotiatedRates>
125
+ </RatedShipment>
126
+ <RatedShipment>
127
+ <Service>
128
+ <Code>54</Code>
129
+ </Service>
130
+ <RatedShipmentWarning>
131
+ The weight exceeds the limit for the UPS Letter/Envelope rate and will be rated using the weight.
132
+ </RatedShipmentWarning>
133
+ <RatedShipmentWarning>
134
+ Your invoice may vary from the displayed reference rates
135
+ </RatedShipmentWarning>
136
+ <BillingWeight>
137
+ <UnitOfMeasurement>
138
+ <Code>KGS</Code>
139
+ </UnitOfMeasurement>
140
+ <Weight>8.0</Weight>
141
+ </BillingWeight>
142
+ <TransportationCharges>
143
+ <CurrencyCode>GBP</CurrencyCode>
144
+ <MonetaryValue>229.18</MonetaryValue>
145
+ </TransportationCharges>
146
+ <ServiceOptionsCharges>
147
+ <CurrencyCode>GBP</CurrencyCode>
148
+ <MonetaryValue>0.00</MonetaryValue>
149
+ </ServiceOptionsCharges>
150
+ <TotalCharges>
151
+ <CurrencyCode>GBP</CurrencyCode>
152
+ <MonetaryValue>229.18</MonetaryValue>
153
+ </TotalCharges><GuaranteedDaysToDelivery/>
154
+ <ScheduledDeliveryTime/>
155
+ <RatedPackage>
156
+ <TransportationCharges>
157
+ <CurrencyCode/>
158
+ <MonetaryValue/>
159
+ </TransportationCharges>
160
+ <ServiceOptionsCharges>
161
+ <CurrencyCode/>
162
+ <MonetaryValue/>
163
+ </ServiceOptionsCharges>
164
+ <TotalCharges>
165
+ <CurrencyCode/>
166
+ <MonetaryValue/>
167
+ </TotalCharges>
168
+ <Weight>8.0</Weight>
169
+ <BillingWeight>
170
+ <UnitOfMeasurement>
171
+ <Code/>
172
+ </UnitOfMeasurement>
173
+ <Weight/>
174
+ </BillingWeight>
175
+ </RatedPackage>
176
+ <NegotiatedRates>
177
+ <NetSummaryCharges>
178
+ <GrandTotal>
179
+ <CurrencyCode>GBP</CurrencyCode>
180
+ <MonetaryValue>226.89</MonetaryValue>
181
+ </GrandTotal>
182
+ </NetSummaryCharges>
183
+ </NegotiatedRates>
184
+ </RatedShipment>
185
+ </RatingServiceSelectionResponse>