The aim of this connector is to implement data sharing between Connec! and Shopify
Configure your Shopify application. To create a new Shopify application: https://docs.shopify.com/api/guides/introduction/getting-started
Create a configuration file config/application.yml
with the following settings (complete with your Shopify / Connec! credentials)
connec_api_id:
connec_api_key:
shopify_api_id:
shopify_api_key:
# Install JRuby and gems the first time, install redis-server
rvm install jruby-9.0.5.0
gem install bundler
bundle
gem install foreman
sudo apt-get install redis-server
export PORT=5678
export RACK_ENV=development
foreman start
Add in the application.yml file the following properties:
api_host: 'http://localhost:3000'
connec_host: 'http://localhost:8080'
Install ngrok Start in on your application port (for example 5678)
ngrok http 5678
this will open a console with an url that is tunnelling to your localhost (for example https://aee0c964.ngrok.io)
update the app_host
in the application.yml
app_host: 'https://aee0c964.ngrok.
then edit your app settings in Shopify https://app.shopify.com/services/partners/api_clients/[YOURAPPID]/edit add the redirection URL:
this command will destroy all the webhooks of the shopify shop linked to the application.
org_uid = 'cld-9p9y'
o = Maestrano::Connector::Rails::Organization.find_by_uid(org_uid)
Shopify::Webhooks::WebhooksManager.new(org_uid, o.oauth_uid, o.oauth_token).destroy_all_webhooks
shop = 'uat-test-store.myshopify.com'
o = Maestrano::Connector::Rails::Organization.find_by_oauth_uid(shop)
Shopify::Webhooks::WebhooksManager.new(o.uid, o.oauth_uid, o.oauth_token).destroy_all_webhooks
How to update the application metadata in MnoHub console
url = 'https://aa386fdb.ngrok.io'
metadata_url = url + '/maestrano/metadata'
app = App.where("name LIKE :prefix", prefix: "%shopify%").first
if app
app.fetch_metadata!(metadata_url)
else
p 'could not find shopify App'
end