zanders 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zanders/order.rb +14 -4
- data/lib/zanders/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fdcfd0ece2d13153f3ce02b62cfdf22630851fe7
|
4
|
+
data.tar.gz: 62c47e6ac2998cb93e32f14b1b09e5b26613d548
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c07356d01695da4d69a2b1a9b12868fe18e2390cbb24cfdb824085d411a56c8c5c9fc2242074f4e5711c4a148c4402ba68e2a998ad9663634b0f1309828f66a0
|
7
|
+
data.tar.gz: 870ff7fce372ac32d394d187982d2287bf747e60ec641360e40155b6beaa80252f50366c9f085fb715b7386422d62c7be4a53517759fc028a77678124a03c690
|
data/lib/zanders/order.rb
CHANGED
@@ -39,7 +39,7 @@ module Zanders
|
|
39
39
|
# purchase_order - internal identifier for the order
|
40
40
|
#
|
41
41
|
# Returns an order_number
|
42
|
-
def create_order(items, address, purchase_order)
|
42
|
+
def create_order(items, address, purchase_order, details = {})
|
43
43
|
order = build_order_data
|
44
44
|
order_items = Array.new
|
45
45
|
|
@@ -57,11 +57,16 @@ module Zanders
|
|
57
57
|
shipping_information = [
|
58
58
|
{ key: 'shipToNo', value: ship_to_number[:ship_to_number] },
|
59
59
|
{ key: 'shipDate', value: Time.now.strftime("%Y-%m-%d") },
|
60
|
-
|
61
|
-
{ key: 'ShipViaCode', value: 'UG' },
|
60
|
+
{ key: 'shipViaCode', value: 'UG' },
|
62
61
|
{ key: 'purchaseOrderNumber', value: purchase_order }
|
63
62
|
]
|
64
63
|
|
64
|
+
if details[:name]
|
65
|
+
shipping_information.push(
|
66
|
+
{ key: 'shipInstructions', value: format_shipping_instructions(details[:name], details[:phone_number]) }
|
67
|
+
)
|
68
|
+
end
|
69
|
+
|
65
70
|
# NOTE-david
|
66
71
|
# order(ns2 map)
|
67
72
|
# item
|
@@ -75,7 +80,7 @@ module Zanders
|
|
75
80
|
order[:order] = Hash.new
|
76
81
|
order[:order][:item] = shipping_information
|
77
82
|
|
78
|
-
order_items = {item: order_items, attributes!: { item: { "xsi:type" => "ns2:Map"} }}
|
83
|
+
order_items = {item: order_items, attributes!: { item: { "xsi:type" => "ns2:Map"}, value: {"SOAP-ENC:arrayType" => "ns2:Map[2]", "xsi:type" => "SOAP-ENV:Array"} }}
|
79
84
|
|
80
85
|
order[:order][:item].push({
|
81
86
|
key: 'items',
|
@@ -164,5 +169,10 @@ module Zanders
|
|
164
169
|
hash
|
165
170
|
end
|
166
171
|
|
172
|
+
def format_shipping_instructions(name, phone_number)
|
173
|
+
shipping_instructions = "%-40.40s" % name
|
174
|
+
shipping_instructions += phone_number
|
175
|
+
end
|
176
|
+
|
167
177
|
end
|
168
178
|
end
|
data/lib/zanders/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zanders
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Knight
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|