cyberbiz_express 0.1.4 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +2 -2
- data/cyberbiz_express-0.1.3.gem +0 -0
- data/cyberbiz_express-0.1.4.gem +0 -0
- data/lib/cyberbiz_express/ninja_van/api.rb +10 -5
- data/lib/cyberbiz_express/version.rb +1 -1
- metadata +4 -5
- data/cyberbiz_express-0.1.0.gem +0 -0
- data/cyberbiz_express-0.1.1.gem +0 -0
- data/cyberbiz_express-0.1.2.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a9edae61dab1775700368f1d90b4314d0c428906f2e738e3a1ff9bf35619bbf
|
4
|
+
data.tar.gz: ca365436a2d85a8256fb8049f648981bc37f78591347f989d87256d52f9bc80e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ffed83905c258093ee17d2816421499a3cc54ba4cca7688f4312c1ca033f88aa00d1e8bf349741f67ff93640d6bf77d807fed695230ee1d32a8b61210238b2e
|
7
|
+
data.tar.gz: afcd8c3becf90b18f46e6c135e0478d795f64cb5201e22c844d0aec1355a536e660baa1807d6f45f8e307c1d1ed9c1cff1860b8be0e4c6c0f0138592d02ad6df
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -72,7 +72,7 @@ shop = {
|
|
72
72
|
zip_code: '51200',
|
73
73
|
}
|
74
74
|
options = {
|
75
|
-
service_type: 'Parcel'
|
75
|
+
service_type: 'Parcel',
|
76
76
|
pickup_date: '2024-12-31',
|
77
77
|
pickup_start_time: '09:01',
|
78
78
|
pickup_end_time: '13:31',
|
@@ -81,7 +81,7 @@ options = {
|
|
81
81
|
delivery_end_time: '13:31',
|
82
82
|
insured_value: 300.21,
|
83
83
|
total_weight: 4.5,
|
84
|
-
pickup_instructions: 'If recipient is not around, leave parcel in power riser.'
|
84
|
+
pickup_instructions: 'If recipient is not around, leave parcel in power riser.',
|
85
85
|
delivery_instructions: 'Hello Ninja Van!',
|
86
86
|
}
|
87
87
|
CyberbizExpress::NinjaVan::Api.new('ninja_van').submit_order(order, shipping_address, shop, options)
|
Binary file
|
Binary file
|
@@ -93,8 +93,8 @@ module CyberbizExpress
|
|
93
93
|
|
94
94
|
def access_token_payload
|
95
95
|
{
|
96
|
-
client_id:
|
97
|
-
client_secret:
|
96
|
+
client_id: CyberbizExpress::NinjaVan.client_id,
|
97
|
+
client_secret: CyberbizExpress::NinjaVan.client_secret,
|
98
98
|
grant_type: 'client_credentials',
|
99
99
|
}
|
100
100
|
end
|
@@ -149,8 +149,8 @@ module CyberbizExpress
|
|
149
149
|
city: shipping_address['city'],
|
150
150
|
state: shipping_address['province'],
|
151
151
|
address_type: 'home',
|
152
|
-
country: shipping_address['
|
153
|
-
postcode: shipping_address['
|
152
|
+
country: shipping_address['location'],
|
153
|
+
postcode: shipping_address['zip_code'],
|
154
154
|
},
|
155
155
|
},
|
156
156
|
parcel_job: {
|
@@ -175,11 +175,16 @@ module CyberbizExpress
|
|
175
175
|
weight: options['total_weight'],
|
176
176
|
},
|
177
177
|
insured_value: options['insured_value'],
|
178
|
-
items: order['line_items']
|
178
|
+
items: line_items_hash(order['line_items']),
|
179
179
|
},
|
180
180
|
}
|
181
181
|
end
|
182
182
|
|
183
|
+
def line_items_hash(line_items)
|
184
|
+
line_items = line_items.map { |item| item.transform_keys(&:to_s) }
|
185
|
+
line_items.map { |item| { item_description: item['name'], quantity: item['quantity'] } }
|
186
|
+
end
|
187
|
+
|
183
188
|
def stringify_keys(hash)
|
184
189
|
hash.transform_keys(&:to_s)
|
185
190
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cyberbiz_express
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roelly
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Use for get tracking_number, confirm shipping and track shipping status.
|
14
14
|
email:
|
@@ -28,9 +28,8 @@ files:
|
|
28
28
|
- Rakefile
|
29
29
|
- bin/console
|
30
30
|
- bin/setup
|
31
|
-
- cyberbiz_express-0.1.
|
32
|
-
- cyberbiz_express-0.1.
|
33
|
-
- cyberbiz_express-0.1.2.gem
|
31
|
+
- cyberbiz_express-0.1.3.gem
|
32
|
+
- cyberbiz_express-0.1.4.gem
|
34
33
|
- cyberbiz_express.gemspec
|
35
34
|
- lib/cyberbiz_express/express_base.rb
|
36
35
|
- lib/cyberbiz_express/ninja_van/api.rb
|
data/cyberbiz_express-0.1.0.gem
DELETED
Binary file
|
data/cyberbiz_express-0.1.1.gem
DELETED
Binary file
|
data/cyberbiz_express-0.1.2.gem
DELETED
Binary file
|