Quantcast
Channel: Opinion: Shopify Community - Shopify APIs & SDKs
Viewing all articles
Browse latest Browse all 25503

MrGossett commented on ActiveResource::SSLError

$
0
0

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


Viewing all articles
Browse latest Browse all 25503

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>