gun_accessory_supply 0.0.2 → 0.0.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: adf4003e7ce333052c677e91eb6e09a72c38e158b9331d684b08aaffd3d9a867
|
4
|
+
data.tar.gz: d1108146ba8e8a17e9a1afa4d9e6620f5bab0703b285e415d122a5cbff8eb060
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab3795c87f78a0fdda4e9bde251e140078043b8bd49fb93eec5c3943a18524085baaa190b3dbdd63c65a28a05edeed7958f056e6bca3141f17e711a8da235f4d
|
7
|
+
data.tar.gz: 5ae910db9102ee76f8fec9978c8107e148a8a4e29d7367d67364bcf5def128a6372487ce7271bf8e1f68fa8110f9237062d0be0078cf22832b50428054c56959
|
@@ -31,7 +31,7 @@ module GunAccessorySupply
|
|
31
31
|
item = {
|
32
32
|
item_identifier: row[@headers.index('Item ID')].try(:strip),
|
33
33
|
quantity: row[@headers.index('Available Qty')].to_i,
|
34
|
-
price: row[@headers.index('
|
34
|
+
price: row[@headers.index('Dealer Cost')].try(:strip),
|
35
35
|
}
|
36
36
|
|
37
37
|
items << item
|
@@ -32,7 +32,7 @@ module GunAccessorySupply
|
|
32
32
|
# * :special_instructions [String] optional
|
33
33
|
def add_recipient(hash = {})
|
34
34
|
requires!(hash, :dealer_name, :shipping)
|
35
|
-
requires!(hash[:shipping], :name, :address, :city, :state, :zip, :email
|
35
|
+
requires!(hash[:shipping], :name, :address, :city, :state, :zip, :email)
|
36
36
|
|
37
37
|
@recipient = hash
|
38
38
|
end
|
@@ -45,13 +45,16 @@ module GunAccessorySupply
|
|
45
45
|
# * :price [String]
|
46
46
|
def add_item(item = {})
|
47
47
|
requires!(item, :identifier, :upc, :qty)
|
48
|
+
|
48
49
|
@items << item
|
49
50
|
end
|
50
51
|
|
51
52
|
def filename
|
52
|
-
|
53
|
-
|
54
|
-
|
53
|
+
@filename ||= begin
|
54
|
+
timestamp = Time.now.strftime('%Y%m%d%T').gsub(':', '')
|
55
|
+
|
56
|
+
"GUN-ACCESSORY-SUPPLY-#{@po_number}-#{timestamp}.xml"
|
57
|
+
end
|
55
58
|
end
|
56
59
|
|
57
60
|
def submit!
|
@@ -60,7 +63,6 @@ module GunAccessorySupply
|
|
60
63
|
|
61
64
|
def to_xml
|
62
65
|
output = ""
|
63
|
-
|
64
66
|
xml = Builder::XmlMarkup.new(target: output, indent: 2)
|
65
67
|
|
66
68
|
xml.instruct!(:xml)
|
@@ -68,23 +70,23 @@ module GunAccessorySupply
|
|
68
70
|
xml.cXML(timestamp: Time.now) do
|
69
71
|
xml.Header do
|
70
72
|
xml.From do
|
71
|
-
xml.Credential(domain:
|
72
|
-
xml.Identity
|
73
|
-
xml.SharedSecret
|
73
|
+
xml.Credential(domain: GunAccessorySupply.config.xml_domain) do
|
74
|
+
xml.Identity GunAccessorySupply.config.xml_domain
|
75
|
+
xml.SharedSecret GunAccessorySupply.config.xml_secret
|
74
76
|
xml.OrderID @po_number
|
75
77
|
end
|
76
78
|
end
|
77
79
|
xml.To do
|
78
|
-
xml.Credential(domain:
|
79
|
-
xml.Identity
|
80
|
-
xml.SharedSecret
|
80
|
+
xml.Credential(domain: GunAccessorySupply.config.xml_domain) do
|
81
|
+
xml.Identity GunAccessorySupply.config.xml_domain
|
82
|
+
xml.SharedSecret GunAccessorySupply.config.xml_secret
|
81
83
|
xml.OrderID @po_number
|
82
84
|
end
|
83
85
|
end
|
84
86
|
xml.Sender do
|
85
|
-
xml.Credential(domain:
|
86
|
-
xml.Identity
|
87
|
-
xml.SharedSecret
|
87
|
+
xml.Credential(domain: GunAccessorySupply.config.xml_domain) do
|
88
|
+
xml.Identity GunAccessorySupply.config.xml_domain
|
89
|
+
xml.SharedSecret GunAccessorySupply.config.xml_secret
|
88
90
|
xml.OrderID @po_number
|
89
91
|
end
|
90
92
|
end
|
@@ -94,7 +96,7 @@ module GunAccessorySupply
|
|
94
96
|
xml.OrderRequest do
|
95
97
|
xml.OrderRequestHeader(orderDate: Time.now, type: 'new') do
|
96
98
|
xml.ShipTo do
|
97
|
-
xml.Address do
|
99
|
+
xml.Address(addressID: @ship_to_id) do
|
98
100
|
xml.Name @recipient[:dealer_name]
|
99
101
|
xml.Email @recipient[:shipping][:email]
|
100
102
|
xml.PostalAddress do
|
@@ -108,7 +110,7 @@ module GunAccessorySupply
|
|
108
110
|
end
|
109
111
|
end
|
110
112
|
xml.BillTo do
|
111
|
-
xml.Address
|
113
|
+
xml.Address do
|
112
114
|
xml.Name @recipient[:dealer_name]
|
113
115
|
xml.Email @recipient[:shipping][:email]
|
114
116
|
xml.PostalAddress do
|
data/lib/gun_accessory_supply.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gun_accessory_supply
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tony Beninate
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|