ruby_omx 0.0.25 → 0.0.26
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.
@@ -15,7 +15,7 @@ module RubyOmx
|
|
15
15
|
required_fields = [:item_code] #:item_code, :product_status, :product_name, :product_group, :tax_code, :file_sub_code, :inventory_product_flag, :launch_date
|
16
16
|
raise MissingRequestOptions if required_fields.any? { |option| attrs[option].nil? }
|
17
17
|
super
|
18
|
-
self.version = attrs[:version] ||= '
|
18
|
+
self.version = attrs[:version] ||= '1.00'
|
19
19
|
self.udi_parameters << RubyOmx::UDIParameter.new({:key=>'ItemCode', :value=>attrs[:item_code]})
|
20
20
|
self.udi_parameters << RubyOmx::UDIParameter.new({:key=>'Keycode', :value=>attrs[:keycode]}) if attrs[:keycode]
|
21
21
|
self.udi_parameters << RubyOmx::UDIParameter.new({:key=>'Type', :value=>attrs[:type]}) if attrs[:type]
|
@@ -25,17 +25,6 @@ module RubyOmx
|
|
25
25
|
xml_reader :line_cogs, :from=>'LineCOGS', :as=>Float
|
26
26
|
xml_reader :unit_cogs, :from=>'UnitCOGS', :as=>Float
|
27
27
|
xml_reader :supplier_item_code
|
28
|
-
|
29
|
-
|
30
|
-
# OMX Status Codes
|
31
|
-
# 0 complete?, Order cancelled at
|
32
|
-
# 1 cancelled?
|
33
|
-
# 2
|
34
|
-
# 3
|
35
|
-
# 4 Order entered processing at
|
36
|
-
# 5
|
37
|
-
# 6 complete?, All items shipped
|
38
|
-
# 7 shipped?
|
39
28
|
end
|
40
29
|
|
41
30
|
class OrderInfoResponse < StandardResponse
|
@@ -57,5 +46,58 @@ module RubyOmx
|
|
57
46
|
"#{super} #{order_id} #{order_number} #{order_status_code} #{order_status_date} #{line_items.length} #{customer_number}"
|
58
47
|
end
|
59
48
|
end
|
60
|
-
|
49
|
+
|
50
|
+
|
51
|
+
=begin
|
52
|
+
|
53
|
+
OMX STATUS CODES
|
54
|
+
|
55
|
+
|
56
|
+
CustomerMemo
|
57
|
+
Status
|
58
|
+
0 none | 10 unread | 20 read |
|
59
|
+
|
60
|
+
OrderAdditionalPayment
|
61
|
+
CreditCardStatus
|
62
|
+
0 pending | 1 charge approved | 2 charge declined | 3 charge invalid | 7 communication failure | 9 charge in transit | 11 authorization approved| 12 authorization declined | 13 authorization invalid | 90 cancelled |
|
63
|
+
|
64
|
+
OrderAdditionalPayment
|
65
|
+
CreditCardAuthStatus
|
66
|
+
0 | 1 | 2 | 3 | 7 | 11 | 12 | 13 | 90 |
|
67
|
+
same as above
|
68
|
+
|
69
|
+
OrderHeader
|
70
|
+
CreditCardStatus
|
71
|
+
0 | 1 | 2 | 3 | 9 | 11 | 12 | 13 |
|
72
|
+
same as above
|
73
|
+
|
74
|
+
OrderHeader
|
75
|
+
CreditCardAuthStatus
|
76
|
+
0 | 11 |
|
77
|
+
same as above
|
78
|
+
|
79
|
+
OrderHeader
|
80
|
+
OrderStatus
|
81
|
+
0 pending | 2 clearing | 3 backordered¹ | 5 on hold | 20 backordered² | 30 warehouse | 40 shipped | 50 returned | 52 pending returned | 90 cancelled | 95 auto-cancelled | 96 voided shipment |
|
82
|
+
|
83
|
+
OrderLine
|
84
|
+
LineStatus
|
85
|
+
0 | 2 | 3 | 5 | 8 held-to-complete¹| 20 | 28 held-to-complete²| 30 | 40 | 50 | 52 | 90 | 95 | 96 |
|
86
|
+
rest same as above
|
87
|
+
|
88
|
+
OrderLine
|
89
|
+
PreHoldLineStatus
|
90
|
+
0 pending | 3 backordered | 8 held-to-complete¹| 10 released | 20 backordered² | 28 held-to-complete²|
|
91
|
+
|
92
|
+
PurchaseOrderHeader
|
93
|
+
POStatus
|
94
|
+
10 open | 60 received | 90 cancelled |
|
95
|
+
|
96
|
+
PurchaseOrderLine
|
97
|
+
Status
|
98
|
+
10 | 60 | 90 |
|
99
|
+
same as above
|
100
|
+
|
101
|
+
=end
|
102
|
+
|
61
103
|
end
|
data/lib/ruby_omx/version.rb
CHANGED
data/test/real_test.rb
CHANGED
@@ -8,11 +8,10 @@ class RealTestTest < MiniTest::Unit::TestCase
|
|
8
8
|
@line1 = { :item_code=>'WATCH-1', :quantity => 1, :price => 122.50 }
|
9
9
|
@line2 = { :item_code=>'APPLE-12', :quantity => 31, :price => 1.50 }
|
10
10
|
end
|
11
|
-
|
12
11
|
=begin
|
13
12
|
def test_real_item_update
|
14
13
|
request_attrs = {:items=> [{
|
15
|
-
:item_code => '
|
14
|
+
:item_code => '1234567890123451043235234234',
|
16
15
|
:product_status=>'True',
|
17
16
|
:incomplete_flag=>'False',
|
18
17
|
:product_name=>'Apple Product',
|
@@ -44,17 +43,16 @@ class RealTestTest < MiniTest::Unit::TestCase
|
|
44
43
|
puts response.to_s
|
45
44
|
assert_kind_of PurchaseOrderUpdateResponse, response
|
46
45
|
end
|
47
|
-
|
46
|
+
|
48
47
|
def test_real_order_info
|
49
|
-
order_info_data = { :order_id => '102-4169344-8910627', :store_code=>'Amazon.com MFN HDO' }
|
48
|
+
order_info_data = { :order_id => '102-4169344-8910627', :store_code=>'Amazon.com MFN HDO', :version=>'2.00' }
|
50
49
|
r = @connection.build_info_request(order_info_data)
|
51
50
|
assert_instance_of String, r.to_xml.to_s
|
52
51
|
puts r.to_xml.to_s
|
53
52
|
|
54
53
|
response = @connection.send_info_request(order_info_data)
|
55
|
-
puts response.to_s
|
54
|
+
puts response.to_xml.to_s
|
56
55
|
assert_kind_of OrderInfoResponse, response
|
57
56
|
end
|
58
57
|
=end
|
59
|
-
|
60
58
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_omx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.26
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-08-
|
12
|
+
date: 2012-08-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: roxml
|