mws-orders 0.5.0 → 0.5.1
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 +4 -4
 - data/README.md +2 -2
 - data/lib/mws/orders/document.rb +17 -3
 - data/lib/mws/orders/order.rb +2 -2
 - data/lib/mws/orders/orders.rb +1 -1
 - data/lib/mws/orders/service_status.rb +1 -1
 - data/lib/mws/orders/version.rb +1 -1
 - metadata +1 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: ade6a5c1c3498da87514f76fb4e6304e1914c0f4a520641e0df1cee2533e97b5
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: ce196f172eb0cbaf1f0e994151bff632550cabbe5949d1d72abff1dad3d0ad26
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 19cba4b4ceff9c1889611f27272fcb090e818c1f7bf888108ccf5c5e82a488541c1a3b0d8a6fafd1a96af313fa10d795fcacb6d86d24869cd20ac7705f63296b
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 493cf6bade595b54da1cee5234e40c79a2de8f01b6281c4843ceb0582ef58327ec0bb4de711dfc229312153b16a530b8df0b0ec38e4ae1687e58fcc9a5928e5e
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -39,7 +39,7 @@ client.list_orders_by_next_token(orders.next_token).parse 
     | 
|
| 
       39 
39 
     | 
    
         
             
            Get one or more orders based on their order numbers:
         
     | 
| 
       40 
40 
     | 
    
         | 
| 
       41 
41 
     | 
    
         
             
            ```ruby
         
     | 
| 
       42 
     | 
    
         
            -
            response = client.get_order(' 
     | 
| 
      
 42 
     | 
    
         
            +
            response = client.get_order('902-3159896-1390916')
         
     | 
| 
       43 
43 
     | 
    
         
             
            order = response.parse
         
     | 
| 
       44 
44 
     | 
    
         
             
            order.inspect # => #<MWS::Orders::Order 902-3159896-1390916>
         
     | 
| 
       45 
45 
     | 
    
         
             
            ```
         
     | 
| 
         @@ -49,7 +49,7 @@ order.inspect # => #<MWS::Orders::Order 902-3159896-1390916> 
     | 
|
| 
       49 
49 
     | 
    
         
             
            List order items:
         
     | 
| 
       50 
50 
     | 
    
         | 
| 
       51 
51 
     | 
    
         
             
            ```ruby
         
     | 
| 
       52 
     | 
    
         
            -
            response = client.list_order_items(' 
     | 
| 
      
 52 
     | 
    
         
            +
            response = client.list_order_items('902-3159896-1390916')
         
     | 
| 
       53 
53 
     | 
    
         
             
            order_items = response.parse
         
     | 
| 
       54 
54 
     | 
    
         
             
            ```
         
     | 
| 
       55 
55 
     | 
    
         | 
    
        data/lib/mws/orders/document.rb
    CHANGED
    
    | 
         @@ -11,17 +11,31 @@ module MWS 
     | 
|
| 
       11 
11 
     | 
    
         
             
                  end
         
     | 
| 
       12 
12 
     | 
    
         | 
| 
       13 
13 
     | 
    
         
             
                  def xpath(path)
         
     | 
| 
       14 
     | 
    
         
            -
                    node.xpath(add_namespace(path))
         
     | 
| 
      
 14 
     | 
    
         
            +
                    node.xpath(add_namespace(path), namespaces)
         
     | 
| 
       15 
15 
     | 
    
         
             
                  end
         
     | 
| 
       16 
16 
     | 
    
         | 
| 
       17 
17 
     | 
    
         
             
                  def at_xpath(path)
         
     | 
| 
       18 
     | 
    
         
            -
                    node.at_xpath(add_namespace(path))
         
     | 
| 
      
 18 
     | 
    
         
            +
                    node.at_xpath(add_namespace(path), namespaces)
         
     | 
| 
       19 
19 
     | 
    
         
             
                  end
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
21 
     | 
    
         
             
                  private
         
     | 
| 
       22 
22 
     | 
    
         | 
| 
       23 
23 
     | 
    
         
             
                  def add_namespace(path)
         
     | 
| 
       24 
     | 
    
         
            -
                    path.split('/') 
     | 
| 
      
 24 
     | 
    
         
            +
                    path.split('/')
         
     | 
| 
      
 25 
     | 
    
         
            +
                        .map { |attr| attr.include?(':') ? attr : "xmlns:#{attr}" }
         
     | 
| 
      
 26 
     | 
    
         
            +
                        .join('/')
         
     | 
| 
      
 27 
     | 
    
         
            +
                  end
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
                  def namespaces
         
     | 
| 
      
 30 
     | 
    
         
            +
                    @namespaces ||= collect_namespaces
         
     | 
| 
      
 31 
     | 
    
         
            +
                  end
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
                  def collect_namespaces
         
     | 
| 
      
 34 
     | 
    
         
            +
                    document = node&.document || node
         
     | 
| 
      
 35 
     | 
    
         
            +
                    document.collect_namespaces.each_with_object({}) do |namespace, hsh|
         
     | 
| 
      
 36 
     | 
    
         
            +
                      key, val = namespace
         
     | 
| 
      
 37 
     | 
    
         
            +
                      hsh[key.sub(/^xmlns:/, '')] = val
         
     | 
| 
      
 38 
     | 
    
         
            +
                    end
         
     | 
| 
       25 
39 
     | 
    
         
             
                  end
         
     | 
| 
       26 
40 
     | 
    
         
             
                end
         
     | 
| 
       27 
41 
     | 
    
         
             
              end
         
     | 
    
        data/lib/mws/orders/order.rb
    CHANGED
    
    | 
         @@ -62,8 +62,8 @@ module MWS 
     | 
|
| 
       62 
62 
     | 
    
         
             
                  end
         
     | 
| 
       63 
63 
     | 
    
         | 
| 
       64 
64 
     | 
    
         
             
                  attribute(:payment_execution_detail) do
         
     | 
| 
       65 
     | 
    
         
            -
                     
     | 
| 
       66 
     | 
    
         
            -
             
     | 
| 
      
 65 
     | 
    
         
            +
                    entities('PaymentExecutionDetail/PaymentExecutionDetailItem',
         
     | 
| 
      
 66 
     | 
    
         
            +
                             PaymentExecutionDetailItem)
         
     | 
| 
       67 
67 
     | 
    
         
             
                  end
         
     | 
| 
       68 
68 
     | 
    
         | 
| 
       69 
69 
     | 
    
         
             
                  attribute(:payment_method) do
         
     | 
    
        data/lib/mws/orders/orders.rb
    CHANGED
    
    
    
        data/lib/mws/orders/version.rb
    CHANGED