<commit_before>module Spree
  module Retail
    module Shopify
      module Hooks
        class OrdersController < HooksController
          def create
            shopify_order = ShopifyAPI::Order.find(shopify_order_id)
            Spree::Retail::Shopify::GeneratePosOrder.new(shopify_order).process

            head :ok
          end

          def shopify_order_id
            json_body['order']['id']
          end
        end
      end
    end
  end
end
<commit_msg>Fix how we fetch the ID of the order from the hook<commit_after>module Spree
  module Retail
    module Shopify
      module Hooks
        class OrdersController < HooksController
          def create
            shopify_order = ShopifyAPI::Order.find(shopify_order_id)
            Spree::Retail::Shopify::GeneratePosOrder.new(shopify_order).process

            head :ok
          end

          def shopify_order_id
            json_body['id']
          end
        end
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.05555555555555555, 'fraction_numerical': 0.0, 'mean_word_length': 1.878698224852071, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6271289', 'n_tokens_mistral': 274, 'n_tokens_neox': 265, 'n_words': 67}