Theo,
I was experience the same issue. I was able to resolve it by editing the index method in HomeController like this:
def index if Shop.where(:name => ShopifyAPI::Shop.current.name).exists? session[:shop] = Shop.where(:name => ShopifyAPI::Shop.current.name).first.id else shop = Shop.new(name: ShopifyAPI::Shop.current.name, url: "http://#{ShopifyAPI::Shop.current.myshopify_domain}", installed: true, access_token: session[:shopify].token) shop.save session[:shop] = shop.id init_webhooks end @shop = Shop.find(session[:shop]) end
If you use ShopifyAPI::Shop.current.domain, then API requests will go to the shop's primary domain name instead of the *.myshopify.com domain name. When I changed that line to use ShopifyAPI::Shop.current.myshopify_domain, the error went away.
You'll probably have to update the URL attribute for all the Shops in your database after making the switch. HTH.
--
Tim