ruby_omx 0.0.23 → 0.0.24

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,7 +8,7 @@ module RubyOmx
8
8
  # Require either an order number or a store code and an order id to locate the order
9
9
  raise MissingRequestOptions if attrs[:order_number].nil? && (attrs[:store_code].nil? || attrs[:order_id].nil?)
10
10
  super
11
- self.version = attrs[:version] ||= '1.00'
11
+ self.version = attrs[:version] ||= '2.00'
12
12
  self.udi_parameters << RubyOmx::UDIParameter.new({:key=>'OrderNumber', :value=>attrs[:order_number]}) if attrs[:order_number]
13
13
  self.udi_parameters << RubyOmx::UDIParameter.new({:key=>'OrderID', :value=>attrs[:order_id]}) if attrs[:order_id]
14
14
  self.udi_parameters << RubyOmx::UDIParameter.new({:key=>'StoreCode', :value=>attrs[:store_code]}) if attrs[:store_code]
@@ -52,6 +52,10 @@ module RubyOmx
52
52
  xml_reader :customer_number, :from=>'@number', :in=>'Customer'
53
53
  xml_reader :tracking_number, :in=>'ShippingInformation/Shipment'
54
54
  xml_reader :ship_date, :in=>'ShippingInformation/Shipment',:as=>DateTime # if populated, it means all items have shipped
55
+
56
+ def to_s
57
+ "#{super} #{order_id} #{order_number} #{order_status_code} #{order_status_date} #{line_items.length} #{customer_number}"
58
+ end
55
59
  end
56
60
 
57
61
  end
@@ -1,3 +1,3 @@
1
1
  module RubyOmx
2
- VERSION = "0.0.23"
2
+ VERSION = "0.0.24"
3
3
  end
data/test/orders_test.rb CHANGED
@@ -189,7 +189,7 @@ class OrdersTest < MiniTest::Unit::TestCase
189
189
 
190
190
  def test_send_info_request1
191
191
  @connection.stubs(:post).returns(xml_for('OrderInformationResponse(1.00)',200))
192
- response = @connection.send_info_request({ :order_number => '16651' })
192
+ response = @connection.send_info_request({ :order_number => '16651', :version=>'1.00' })
193
193
  assert_kind_of OrderInfoResponse, response
194
194
 
195
195
  assert_equal DateTime.parse('2006-02-09 14:47:00'), response.ship_date
@@ -212,7 +212,7 @@ class OrdersTest < MiniTest::Unit::TestCase
212
212
 
213
213
  def test_send_info_request2
214
214
  @connection_alt.stubs(:post).returns(xml_for('OrderInformationResponse(2.00)',200))
215
- response = @connection_alt.send_info_request({ :order_number => '24603', :version=>'2.00' })
215
+ response = @connection_alt.send_info_request({ :order_number => '24603' })
216
216
  assert_kind_of OrderInfoResponse, response
217
217
 
218
218
  assert_nil response.ship_date
@@ -240,7 +240,7 @@ class OrdersTest < MiniTest::Unit::TestCase
240
240
  assert_equal '5/31/2010 5:36:00 AM', response.line_items[0].line_status.date
241
241
  assert_kind_of Hash, response.as_hash
242
242
 
243
- response = @connection_alt.send_info_request({ :order_id=> 'AZ-43253-234', :store_code=>'XX01', :version=>'2.00' })
243
+ response = @connection_alt.send_info_request({ :order_id=> 'AZ-43253-234', :store_code=>'XX01' })
244
244
  assert_kind_of OrderInfoResponse, response
245
245
  end
246
246
 
data/test/real_test.rb CHANGED
@@ -44,9 +44,9 @@ class RealTestTest < MiniTest::Unit::TestCase
44
44
  puts response.to_s
45
45
  assert_kind_of PurchaseOrderUpdateResponse, response
46
46
  end
47
-
47
+
48
48
  def test_real_order_info
49
- order_info_data = { :order_number => '16651', :version=>'2.00' }
49
+ order_info_data = { :order_id => '102-4169344-8910627', :store_code=>'Amazon.com MFN HDO' }
50
50
  r = @connection.build_info_request(order_info_data)
51
51
  assert_instance_of String, r.to_xml.to_s
52
52
  puts r.to_xml.to_s
@@ -55,7 +55,6 @@ class RealTestTest < MiniTest::Unit::TestCase
55
55
  puts response.to_s
56
56
  assert_kind_of OrderInfoResponse, response
57
57
  end
58
-
59
58
  =end
60
59
 
61
60
  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.23
4
+ version: 0.0.24
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: