zanders 1.1.1 → 1.1.2

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
  SHA1:
3
- metadata.gz: 0f927e9162bd444134353495415d04975577554e
4
- data.tar.gz: a3247169ff30f6ca7af432141c8bf2cfae8da3c4
3
+ metadata.gz: fdcfd0ece2d13153f3ce02b62cfdf22630851fe7
4
+ data.tar.gz: 62c47e6ac2998cb93e32f14b1b09e5b26613d548
5
5
  SHA512:
6
- metadata.gz: 0f42bc9d2d1c789323ec772f568e95e2460442f4e1e18b4f2da06b7fe85432b5a0f541a9dc80f1f10b0d0a0f6951ba6f78364a71f7d7063b32405c0181e4d8f8
7
- data.tar.gz: 074d24bcf625147b406c5d828ad2147b8e074974258fc5c97b07dc472c93f6d12069550b45c8a5fb7a6cc5da61b4158a3d43d187dc215643c03f729a99ff1f7b
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
- # TODO-david
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
@@ -1,3 +1,3 @@
1
1
  module Zanders
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
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.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-18 00:00:00.000000000 Z
11
+ date: 2017-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri