lucid_shopify 0.22.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ffbd2b79dfc1ae3312e616d87871ec8b3baf489fcc02ec3821015157899dd0c3
4
- data.tar.gz: 0fd1e6b2a658ca0752ad3c6e4e306ce50297f2788893f1771d95c42af8c1947c
3
+ metadata.gz: c225c729d5ced22978539c22523dc007e1e4219fe7333784aff780022d969999
4
+ data.tar.gz: af1375251a30898d6f025b849749482b976a25223e563666d055e4edc7fcc0d7
5
5
  SHA512:
6
- metadata.gz: 2f46bfa127089ee1da925feeb4b71cc9627666a92c70f5377fc25481bd9f6729bf2251f11ddf177764b33f49a2c89d392479012b253489e6627f1c2a545c78a2
7
- data.tar.gz: d454294b7418c42e476559fac49ea149a3edc79ebd4117841d965571e7e138dca511cbb534a9cce7fcb910e04973dde0bfbf192f91c9a629f268f6eea332491e
6
+ metadata.gz: 2125841d6a8aebaad6170d5474b1796ce348d65d16261425b3dde750456eecb4c0a2a3355738951c3707422dd15e276e00b3a0021af6d832958c555704e458d2
7
+ data.tar.gz: 8c675d75398adf165686cea0531ae9bb31154b98cc880c8303416262bb8b27a343ac9d285225287a2c3fc7d7aec955fb2e2631c1d3df5501724f0a7e61de1469
data/README.md CHANGED
@@ -28,14 +28,14 @@ the default unconfigured behaviour is equivalent to:
28
28
 
29
29
  LucidShopify.config = LucidShopify::Config::PRIVATE_APP
30
30
 
31
- Additionally, each API request requires authorization:
31
+ Additionally, each API request requires authorisation:
32
32
 
33
33
  credentials = LucidShopify::Credentials.new(
34
34
  '...', # myshopify_domain
35
35
  '...', # access_token
36
36
  )
37
37
 
38
- If the access token is omitted, the request will be unauthorized.
38
+ If the access token is omitted, the request will be unauthorised.
39
39
  This is only useful during the OAuth2 process.
40
40
 
41
41
 
@@ -100,11 +100,11 @@ Verify webhook requests with the request data and the HMAC header:
100
100
  end
101
101
 
102
102
 
103
- ### Authorization
103
+ ### Authorisation
104
104
 
105
- authorize = LucidShopify::Authorize.new
105
+ authorise = LucidShopify::Authorise.new
106
106
 
107
- access_token = authorize.(credentials, authorization_code)
107
+ access_token = authorise.(credentials, authorisation_code)
108
108
 
109
109
 
110
110
  ### Billing
data/lib/lucid_shopify.rb CHANGED
@@ -9,7 +9,7 @@ end
9
9
 
10
10
  module LucidShopify
11
11
  autoload :ActivateCharge, 'lucid_shopify/activate_charge'
12
- autoload :Authorize, 'lucid_shopify/authorize'
12
+ autoload :Authorise, 'lucid_shopify/authorise'
13
13
  autoload :Client, 'lucid_shopify/client'
14
14
  autoload :Container, 'lucid_shopify/container'
15
15
  autoload :CreateAllWebhooks, 'lucid_shopify/create_all_webhooks'
@@ -3,7 +3,7 @@
3
3
  require 'lucid_shopify/container'
4
4
 
5
5
  module LucidShopify
6
- class Authorize
6
+ class Authorise
7
7
  Error = Class.new(Error)
8
8
 
9
9
  #
@@ -14,19 +14,19 @@ module LucidShopify
14
14
  end
15
15
 
16
16
  #
17
- # Exchange an authorization code for a new Shopify access token.
17
+ # Exchange an authorisation code for a new Shopify access token.
18
18
  #
19
19
  # @param myshopify_domain [String]
20
- # @param authorization_code [String]
20
+ # @param authorisation_code [String]
21
21
  #
22
22
  # @return [String] the access token
23
23
  #
24
24
  # @raise [Error] if the response is invalid
25
25
  #
26
- def call(myshopify_domain, authorization_code)
26
+ def call(myshopify_domain, authorisation_code)
27
27
  credentials = Credentials.new(myshopify_domain)
28
28
 
29
- data = @client.post_json(credentials, 'oauth/access_token', post_data(authorization_code))
29
+ data = @client.post_json(credentials, 'oauth/access_token', post_data(authorisation_code))
30
30
 
31
31
  raise Error if data['access_token'].nil?
32
32
  raise Error if data['scope'] != LucidShopify.config.scope
@@ -35,15 +35,15 @@ module LucidShopify
35
35
  end
36
36
 
37
37
  #
38
- # @param authorization_code [String]
38
+ # @param authorisation_code [String]
39
39
  #
40
40
  # @return [Hash]
41
41
  #
42
- private def post_data(authorization_code)
42
+ private def post_data(authorisation_code)
43
43
  {
44
44
  client_id: LucidShopify.config.api_key,
45
45
  client_secret: LucidShopify.config.shared_secret,
46
- code: authorization_code,
46
+ code: authorisation_code,
47
47
  }
48
48
  end
49
49
  end
@@ -11,7 +11,7 @@ module LucidShopify
11
11
 
12
12
  # Services only (dependencies); no value objects, entities.
13
13
  Container.register(:activate_charge) { ActivateCharge.new }
14
- Container.register(:authorize) { Authorize.new }
14
+ Container.register(:authorise) { Authorise.new }
15
15
  Container.register(:client) { Client.new }
16
16
  Container.register(:create_all_webhooks) { CreateAllWebhooks.new }
17
17
  Container.register(:create_charge) { CreateCharge.new }
@@ -8,7 +8,7 @@ module LucidShopify
8
8
 
9
9
  # @return [String]
10
10
  param :myshopify_domain
11
- # @return [String, nil] if {nil}, request will be unauthorized
11
+ # @return [String, nil] if {nil}, request will be unauthorised
12
12
  param :access_token, optional: true
13
13
  end
14
14
  end
@@ -29,10 +29,10 @@ module LucidShopify
29
29
  private def build_url
30
30
  admin_url = "https://#{credentials.myshopify_domain}/admin"
31
31
 
32
- normalized_path = path.sub(/^\//, '')
33
- normalized_path = path.sub(/\.json$/, '')
32
+ normalised_path = path.sub(/^\//, '')
33
+ normalised_path = path.sub(/\.json$/, '')
34
34
 
35
- admin_url + '/' + normalized_path + '.json'
35
+ admin_url + '/' + normalised_path + '.json'
36
36
  end
37
37
 
38
38
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LucidShopify
4
- VERSION = '0.22.0'
4
+ VERSION = '0.23.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lucid_shopify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.0
4
+ version: 0.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelsey Judson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-22 00:00:00.000000000 Z
11
+ date: 2019-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv
@@ -117,7 +117,7 @@ files:
117
117
  - README.md
118
118
  - lib/lucid_shopify.rb
119
119
  - lib/lucid_shopify/activate_charge.rb
120
- - lib/lucid_shopify/authorize.rb
120
+ - lib/lucid_shopify/authorise.rb
121
121
  - lib/lucid_shopify/client.rb
122
122
  - lib/lucid_shopify/config.rb
123
123
  - lib/lucid_shopify/container.rb