shopify_app 3.0.2 → 3.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -38,6 +38,33 @@ visiting https://YOUR-SHOP.myshopify.com/admin/api
38
38
 
39
39
  This will create a LoginController and a HomeController with their own views.
40
40
 
41
+
42
+ == Set your required API permissions
43
+
44
+ Before making API requests, your application must state which API permissions it requires from the shop it's installed in. These requested permissions will be listed on the screen the merchant sees when approving your app to be installed in their shop.
45
+
46
+ Start by reviewing the documentation on API permission scopes: http://api.shopify.com/authentication.html
47
+
48
+ When you know which ones your app will need, add a scope line to the <tt>config/initializers/omniauth.rb</tt> file.
49
+
50
+ === Example
51
+
52
+ Make this change to request write access to products and read access to orders:
53
+
54
+ Rails.application.config.middleware.use OmniAuth::Builder do
55
+ provider :shopify,
56
+ ShopifyApp.configuration.api_key,
57
+ ShopifyApp.configuration.secret,
58
+ :scope => "write_products,read_orders",
59
+ :setup => lambda {|env|
60
+ params = Rack::Utils.parse_query(env['QUERY_STRING'])
61
+ site_url = "https://#{params['shop']}"
62
+ env['omniauth.strategy'].options[:client_options][:site] = site_url
63
+ }
64
+ end
65
+
66
+ (Note that you can change your API permission scopes on the fly, but the merchant will have to approve each change and your computed API password will change.)
67
+
41
68
  == After running the generator
42
69
 
43
70
  First, start your application:
@@ -46,7 +73,7 @@ First, start your application:
46
73
 
47
74
  Now visit http://localhost:3000 and install your application in a Shopify store.
48
75
 
49
- After your application has been given read or read/write API permission by the
76
+ After your application has been given whatever API permissions you requested by the
50
77
  shop, you're ready to start experimenting with the Shopify API.
51
78
 
52
79
  == Rails 3.0 Support
@@ -11,11 +11,11 @@
11
11
  </div>
12
12
 
13
13
  <p align="center" style="margin-top:30px">
14
- <%= image_tag '../assets/shopify.png' %>
14
+ <%= image_tag 'shopify.png' %>
15
15
  </p>
16
16
 
17
17
  <br/>
18
18
 
19
19
  <p align="center" class="muted">
20
20
  Don't have a shop? <a href="https://app.shopify.com/services/partners/api_clients/test_shops">Create a Test Shop</a>
21
- </p>
21
+ </p>
@@ -2,9 +2,6 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>404 Error: This page doesn't exist!</title>
5
- <link rel="stylesheet" type="text/css" href="../assets/bootstrap.css" />
6
- <link rel="stylesheet" type="text/css" href="../assets/responsive-bootstrap.css" />
7
- <link rel="stylesheet" type="text/css" href="../assets/shopify_app.scss" />
8
5
 
9
6
  <style>
10
7
  .container { text-align:center;}
@@ -2,9 +2,6 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>422 Error: Your change was rejected</title>
5
- <link rel="stylesheet" type="text/css" href="../assets/bootstrap.css" />
6
- <link rel="stylesheet" type="text/css" href="../assets/responsive-bootstrap.css" />
7
- <link rel="stylesheet" type="text/css" href="../assets/shopify_app.scss" />
8
5
 
9
6
  <style>
10
7
  .container { text-align:center;}
@@ -40,4 +37,4 @@
40
37
  </footer>
41
38
  </div> <!-- /container -->
42
39
  </body>
43
- </html>
40
+ </html>
@@ -2,9 +2,6 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>500 Error: Something went horribly wrong</title>
5
- <link rel="stylesheet" type="text/css" href="../assets/bootstrap.css" />
6
- <link rel="stylesheet" type="text/css" href="../assets/responsive-bootstrap.css" />
7
- <link rel="stylesheet" type="text/css" href="../assets/shopify_app.scss" />
8
5
 
9
6
  <style>
10
7
  .container { text-align:center;}
@@ -1,3 +1,3 @@
1
1
  module ShopifyApp
2
- VERSION = "3.0.2"
2
+ VERSION = "3.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify_app
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-15 00:00:00.000000000 Z
12
+ date: 2012-06-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &2155421520 !ruby/object:Gem::Requirement
16
+ requirement: &70355642950800 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3.1'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2155421520
24
+ version_requirements: *70355642950800
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: shopify_api
27
- requirement: &2155421020 !ruby/object:Gem::Requirement
27
+ requirement: &70355642950300 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 3.0.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2155421020
35
+ version_requirements: *70355642950300
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: omniauth-shopify-oauth2
38
- requirement: &2155420560 !ruby/object:Gem::Requirement
38
+ requirement: &70355642949840 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - =
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 1.0.0
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2155420560
46
+ version_requirements: *70355642949840
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
- requirement: &2155420180 !ruby/object:Gem::Requirement
49
+ requirement: &70355642949460 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2155420180
57
+ version_requirements: *70355642949460
58
58
  description: Creates a basic login controller for authenticating with your Shop and
59
59
  also a product controller which lets your edit your products easily.
60
60
  email:
@@ -134,4 +134,3 @@ signing_key:
134
134
  specification_version: 3
135
135
  summary: This gem is used to get quickly started with the Shopify API
136
136
  test_files: []
137
- has_rdoc: