Class: LucidShopify::Authorize
- Inherits:
-
Object
- Object
- LucidShopify::Authorize
- Defined in:
- lib/lucid_shopify/authorize.rb
Constant Summary collapse
- Error =
Class.new(Error)
Instance Method Summary collapse
-
#call(myshopify_domain, authorization_code) ⇒ String
Exchange an authorization code for a new Shopify access token.
-
#initialize(client: Container[:client]) ⇒ Authorize
constructor
A new instance of Authorize.
Constructor Details
Instance Method Details
#call(myshopify_domain, authorization_code) ⇒ String
Exchange an authorization code for a new Shopify access token.
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/lucid_shopify/authorize.rb', line 26 def call(myshopify_domain, ) request_credentials = RequestCredentials.new(myshopify_domain) data = @client.post_json(request_credentials, 'oauth/access_token', post_data()) raise Error if data['access_token'].nil? raise Error if data['scope'] != LucidShopify.config.scope data['access_token'] end |