Class: CheckoutSdk::OAuthSdkCredentials
- Inherits:
-
SdkCredentials
- Object
- SdkCredentials
- CheckoutSdk::OAuthSdkCredentials
- Defined in:
- lib/checkout_sdk/oauth_sdk_credentials.rb
Instance Attribute Summary collapse
- #access_token ⇒ CheckoutSdk::OAuthAccessToken
- #authorization_uri ⇒ String
- #client_id ⇒ String
- #client_secret ⇒ String
- #environment ⇒ CheckoutSdk::Environment
- #http_client ⇒ Object
-
#log ⇒ Object
Returns the value of attribute log.
- #scopes ⇒ Array(CheckoutSdk::OAuthScopes)
Instance Method Summary collapse
- #build_access_token ⇒ CheckoutSdk::OAuthAccessToken
- #get_authorization(authorization_type) ⇒ CheckoutSdk::SdkAuthorization
-
#initialize(client_id, client_secret, scopes, http_client, environment, logger, auth_uri = nil) ⇒ OAuthSdkCredentials
constructor
A new instance of OAuthSdkCredentials.
Constructor Details
#initialize(client_id, client_secret, scopes, http_client, environment, logger, auth_uri = nil) ⇒ OAuthSdkCredentials
Returns a new instance of OAuthSdkCredentials.
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/checkout_sdk/oauth_sdk_credentials.rb', line 34 def initialize(client_id, client_secret, scopes, http_client, environment, logger, auth_uri = nil) validate_arguments client_id, client_secret, environment, auth_uri @client_id = client_id @client_secret = client_secret @scopes = scopes @authorization_uri = auth_uri.nil? ? environment. : auth_uri @oauth_http_client = http_client.clone @oauth_http_client.url_prefix = @authorization_uri @log = logger build_access_token end |
Instance Attribute Details
#access_token ⇒ CheckoutSdk::OAuthAccessToken
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/checkout_sdk/oauth_sdk_credentials.rb', line 18 class OAuthSdkCredentials < SdkCredentials attr_accessor :access_token, :client_id, :client_secret, :scopes, :http_client, :environment, :authorization_uri, :log # @param [String] client_id # @param [String] client_secret # @param [Array(CheckoutSdk::OAuthScopes)] scopes # @param [Faraday::Connection] http_client # @param [CheckoutSdk::Environment] environment # @param [String, nil] auth_uri def initialize(client_id, client_secret, scopes, http_client, environment, logger, auth_uri = nil) validate_arguments client_id, client_secret, environment, auth_uri @client_id = client_id @client_secret = client_secret @scopes = scopes @authorization_uri = auth_uri.nil? ? environment. : auth_uri @oauth_http_client = http_client.clone @oauth_http_client.url_prefix = @authorization_uri @log = logger build_access_token end # @param [String] authorization_type # @return [CheckoutSdk::SdkAuthorization] def () case when AuthorizationType::SECRET_KEY_OR_OAUTH, AuthorizationType::PUBLIC_KEY_OR_OAUTH, AuthorizationType::OAUTH SdkAuthorization.new(PlatformType::DEFAULT, build_access_token.token) else raise CheckoutAuthorizationException. end end # @return [CheckoutSdk::OAuthAccessToken] def build_access_token return @access_token unless @access_token.nil? || @access_token.token.nil? || !@access_token.valid? data = { client_id: @client_id, client_secret: @client_secret, grant_type: 'client_credentials', scope: @scopes.join(' ') } headers = { 'Content-Type': 'application/x-www-form-urlencoded' } body = URI.encode_www_form data begin @log.info "post: #{}" response = @oauth_http_client.run_request(:post, @authorization_uri, body, headers) rescue Faraday::ClientError => e raise CheckoutAuthorizationException, e.response rescue Faraday::ConnectionFailed => e raise CheckoutArgumentException, e.wrapped_exception end if !response.body.nil? && response.body != '' oauth_response = JSON.parse(response.body, object_class: OpenStruct) @access_token = OAuthAccessToken.new(oauth_response.access_token, Time.now + oauth_response.expires_in) end @access_token end private # @param [String] client_id # @param [String] client_secret # @param [Environment] environment # @param [String, nil] authorization_uri def validate_arguments(client_id, client_secret, environment, ) if client_id.nil? || client_secret.nil? raise CheckoutArgumentException, 'Invalid OAuth "client_id" or "client_secret"' end return unless environment.nil? && .nil? raise CheckoutArgumentException, 'Invalid configuration. Please specify an "environment" or a specific OAuth "authorization_uri"' end end |
#authorization_uri ⇒ String
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/checkout_sdk/oauth_sdk_credentials.rb', line 18 class OAuthSdkCredentials < SdkCredentials attr_accessor :access_token, :client_id, :client_secret, :scopes, :http_client, :environment, :authorization_uri, :log # @param [String] client_id # @param [String] client_secret # @param [Array(CheckoutSdk::OAuthScopes)] scopes # @param [Faraday::Connection] http_client # @param [CheckoutSdk::Environment] environment # @param [String, nil] auth_uri def initialize(client_id, client_secret, scopes, http_client, environment, logger, auth_uri = nil) validate_arguments client_id, client_secret, environment, auth_uri @client_id = client_id @client_secret = client_secret @scopes = scopes @authorization_uri = auth_uri.nil? ? environment. : auth_uri @oauth_http_client = http_client.clone @oauth_http_client.url_prefix = @authorization_uri @log = logger build_access_token end # @param [String] authorization_type # @return [CheckoutSdk::SdkAuthorization] def () case when AuthorizationType::SECRET_KEY_OR_OAUTH, AuthorizationType::PUBLIC_KEY_OR_OAUTH, AuthorizationType::OAUTH SdkAuthorization.new(PlatformType::DEFAULT, build_access_token.token) else raise CheckoutAuthorizationException. end end # @return [CheckoutSdk::OAuthAccessToken] def build_access_token return @access_token unless @access_token.nil? || @access_token.token.nil? || !@access_token.valid? data = { client_id: @client_id, client_secret: @client_secret, grant_type: 'client_credentials', scope: @scopes.join(' ') } headers = { 'Content-Type': 'application/x-www-form-urlencoded' } body = URI.encode_www_form data begin @log.info "post: #{}" response = @oauth_http_client.run_request(:post, @authorization_uri, body, headers) rescue Faraday::ClientError => e raise CheckoutAuthorizationException, e.response rescue Faraday::ConnectionFailed => e raise CheckoutArgumentException, e.wrapped_exception end if !response.body.nil? && response.body != '' oauth_response = JSON.parse(response.body, object_class: OpenStruct) @access_token = OAuthAccessToken.new(oauth_response.access_token, Time.now + oauth_response.expires_in) end @access_token end private # @param [String] client_id # @param [String] client_secret # @param [Environment] environment # @param [String, nil] authorization_uri def validate_arguments(client_id, client_secret, environment, ) if client_id.nil? || client_secret.nil? raise CheckoutArgumentException, 'Invalid OAuth "client_id" or "client_secret"' end return unless environment.nil? && .nil? raise CheckoutArgumentException, 'Invalid configuration. Please specify an "environment" or a specific OAuth "authorization_uri"' end end |
#client_id ⇒ String
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/checkout_sdk/oauth_sdk_credentials.rb', line 18 class OAuthSdkCredentials < SdkCredentials attr_accessor :access_token, :client_id, :client_secret, :scopes, :http_client, :environment, :authorization_uri, :log # @param [String] client_id # @param [String] client_secret # @param [Array(CheckoutSdk::OAuthScopes)] scopes # @param [Faraday::Connection] http_client # @param [CheckoutSdk::Environment] environment # @param [String, nil] auth_uri def initialize(client_id, client_secret, scopes, http_client, environment, logger, auth_uri = nil) validate_arguments client_id, client_secret, environment, auth_uri @client_id = client_id @client_secret = client_secret @scopes = scopes @authorization_uri = auth_uri.nil? ? environment. : auth_uri @oauth_http_client = http_client.clone @oauth_http_client.url_prefix = @authorization_uri @log = logger build_access_token end # @param [String] authorization_type # @return [CheckoutSdk::SdkAuthorization] def () case when AuthorizationType::SECRET_KEY_OR_OAUTH, AuthorizationType::PUBLIC_KEY_OR_OAUTH, AuthorizationType::OAUTH SdkAuthorization.new(PlatformType::DEFAULT, build_access_token.token) else raise CheckoutAuthorizationException. end end # @return [CheckoutSdk::OAuthAccessToken] def build_access_token return @access_token unless @access_token.nil? || @access_token.token.nil? || !@access_token.valid? data = { client_id: @client_id, client_secret: @client_secret, grant_type: 'client_credentials', scope: @scopes.join(' ') } headers = { 'Content-Type': 'application/x-www-form-urlencoded' } body = URI.encode_www_form data begin @log.info "post: #{}" response = @oauth_http_client.run_request(:post, @authorization_uri, body, headers) rescue Faraday::ClientError => e raise CheckoutAuthorizationException, e.response rescue Faraday::ConnectionFailed => e raise CheckoutArgumentException, e.wrapped_exception end if !response.body.nil? && response.body != '' oauth_response = JSON.parse(response.body, object_class: OpenStruct) @access_token = OAuthAccessToken.new(oauth_response.access_token, Time.now + oauth_response.expires_in) end @access_token end private # @param [String] client_id # @param [String] client_secret # @param [Environment] environment # @param [String, nil] authorization_uri def validate_arguments(client_id, client_secret, environment, ) if client_id.nil? || client_secret.nil? raise CheckoutArgumentException, 'Invalid OAuth "client_id" or "client_secret"' end return unless environment.nil? && .nil? raise CheckoutArgumentException, 'Invalid configuration. Please specify an "environment" or a specific OAuth "authorization_uri"' end end |
#client_secret ⇒ String
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/checkout_sdk/oauth_sdk_credentials.rb', line 18 class OAuthSdkCredentials < SdkCredentials attr_accessor :access_token, :client_id, :client_secret, :scopes, :http_client, :environment, :authorization_uri, :log # @param [String] client_id # @param [String] client_secret # @param [Array(CheckoutSdk::OAuthScopes)] scopes # @param [Faraday::Connection] http_client # @param [CheckoutSdk::Environment] environment # @param [String, nil] auth_uri def initialize(client_id, client_secret, scopes, http_client, environment, logger, auth_uri = nil) validate_arguments client_id, client_secret, environment, auth_uri @client_id = client_id @client_secret = client_secret @scopes = scopes @authorization_uri = auth_uri.nil? ? environment. : auth_uri @oauth_http_client = http_client.clone @oauth_http_client.url_prefix = @authorization_uri @log = logger build_access_token end # @param [String] authorization_type # @return [CheckoutSdk::SdkAuthorization] def () case when AuthorizationType::SECRET_KEY_OR_OAUTH, AuthorizationType::PUBLIC_KEY_OR_OAUTH, AuthorizationType::OAUTH SdkAuthorization.new(PlatformType::DEFAULT, build_access_token.token) else raise CheckoutAuthorizationException. end end # @return [CheckoutSdk::OAuthAccessToken] def build_access_token return @access_token unless @access_token.nil? || @access_token.token.nil? || !@access_token.valid? data = { client_id: @client_id, client_secret: @client_secret, grant_type: 'client_credentials', scope: @scopes.join(' ') } headers = { 'Content-Type': 'application/x-www-form-urlencoded' } body = URI.encode_www_form data begin @log.info "post: #{}" response = @oauth_http_client.run_request(:post, @authorization_uri, body, headers) rescue Faraday::ClientError => e raise CheckoutAuthorizationException, e.response rescue Faraday::ConnectionFailed => e raise CheckoutArgumentException, e.wrapped_exception end if !response.body.nil? && response.body != '' oauth_response = JSON.parse(response.body, object_class: OpenStruct) @access_token = OAuthAccessToken.new(oauth_response.access_token, Time.now + oauth_response.expires_in) end @access_token end private # @param [String] client_id # @param [String] client_secret # @param [Environment] environment # @param [String, nil] authorization_uri def validate_arguments(client_id, client_secret, environment, ) if client_id.nil? || client_secret.nil? raise CheckoutArgumentException, 'Invalid OAuth "client_id" or "client_secret"' end return unless environment.nil? && .nil? raise CheckoutArgumentException, 'Invalid configuration. Please specify an "environment" or a specific OAuth "authorization_uri"' end end |
#environment ⇒ CheckoutSdk::Environment
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/checkout_sdk/oauth_sdk_credentials.rb', line 18 class OAuthSdkCredentials < SdkCredentials attr_accessor :access_token, :client_id, :client_secret, :scopes, :http_client, :environment, :authorization_uri, :log # @param [String] client_id # @param [String] client_secret # @param [Array(CheckoutSdk::OAuthScopes)] scopes # @param [Faraday::Connection] http_client # @param [CheckoutSdk::Environment] environment # @param [String, nil] auth_uri def initialize(client_id, client_secret, scopes, http_client, environment, logger, auth_uri = nil) validate_arguments client_id, client_secret, environment, auth_uri @client_id = client_id @client_secret = client_secret @scopes = scopes @authorization_uri = auth_uri.nil? ? environment. : auth_uri @oauth_http_client = http_client.clone @oauth_http_client.url_prefix = @authorization_uri @log = logger build_access_token end # @param [String] authorization_type # @return [CheckoutSdk::SdkAuthorization] def () case when AuthorizationType::SECRET_KEY_OR_OAUTH, AuthorizationType::PUBLIC_KEY_OR_OAUTH, AuthorizationType::OAUTH SdkAuthorization.new(PlatformType::DEFAULT, build_access_token.token) else raise CheckoutAuthorizationException. end end # @return [CheckoutSdk::OAuthAccessToken] def build_access_token return @access_token unless @access_token.nil? || @access_token.token.nil? || !@access_token.valid? data = { client_id: @client_id, client_secret: @client_secret, grant_type: 'client_credentials', scope: @scopes.join(' ') } headers = { 'Content-Type': 'application/x-www-form-urlencoded' } body = URI.encode_www_form data begin @log.info "post: #{}" response = @oauth_http_client.run_request(:post, @authorization_uri, body, headers) rescue Faraday::ClientError => e raise CheckoutAuthorizationException, e.response rescue Faraday::ConnectionFailed => e raise CheckoutArgumentException, e.wrapped_exception end if !response.body.nil? && response.body != '' oauth_response = JSON.parse(response.body, object_class: OpenStruct) @access_token = OAuthAccessToken.new(oauth_response.access_token, Time.now + oauth_response.expires_in) end @access_token end private # @param [String] client_id # @param [String] client_secret # @param [Environment] environment # @param [String, nil] authorization_uri def validate_arguments(client_id, client_secret, environment, ) if client_id.nil? || client_secret.nil? raise CheckoutArgumentException, 'Invalid OAuth "client_id" or "client_secret"' end return unless environment.nil? && .nil? raise CheckoutArgumentException, 'Invalid configuration. Please specify an "environment" or a specific OAuth "authorization_uri"' end end |
#http_client ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/checkout_sdk/oauth_sdk_credentials.rb', line 18 class OAuthSdkCredentials < SdkCredentials attr_accessor :access_token, :client_id, :client_secret, :scopes, :http_client, :environment, :authorization_uri, :log # @param [String] client_id # @param [String] client_secret # @param [Array(CheckoutSdk::OAuthScopes)] scopes # @param [Faraday::Connection] http_client # @param [CheckoutSdk::Environment] environment # @param [String, nil] auth_uri def initialize(client_id, client_secret, scopes, http_client, environment, logger, auth_uri = nil) validate_arguments client_id, client_secret, environment, auth_uri @client_id = client_id @client_secret = client_secret @scopes = scopes @authorization_uri = auth_uri.nil? ? environment. : auth_uri @oauth_http_client = http_client.clone @oauth_http_client.url_prefix = @authorization_uri @log = logger build_access_token end # @param [String] authorization_type # @return [CheckoutSdk::SdkAuthorization] def () case when AuthorizationType::SECRET_KEY_OR_OAUTH, AuthorizationType::PUBLIC_KEY_OR_OAUTH, AuthorizationType::OAUTH SdkAuthorization.new(PlatformType::DEFAULT, build_access_token.token) else raise CheckoutAuthorizationException. end end # @return [CheckoutSdk::OAuthAccessToken] def build_access_token return @access_token unless @access_token.nil? || @access_token.token.nil? || !@access_token.valid? data = { client_id: @client_id, client_secret: @client_secret, grant_type: 'client_credentials', scope: @scopes.join(' ') } headers = { 'Content-Type': 'application/x-www-form-urlencoded' } body = URI.encode_www_form data begin @log.info "post: #{}" response = @oauth_http_client.run_request(:post, @authorization_uri, body, headers) rescue Faraday::ClientError => e raise CheckoutAuthorizationException, e.response rescue Faraday::ConnectionFailed => e raise CheckoutArgumentException, e.wrapped_exception end if !response.body.nil? && response.body != '' oauth_response = JSON.parse(response.body, object_class: OpenStruct) @access_token = OAuthAccessToken.new(oauth_response.access_token, Time.now + oauth_response.expires_in) end @access_token end private # @param [String] client_id # @param [String] client_secret # @param [Environment] environment # @param [String, nil] authorization_uri def validate_arguments(client_id, client_secret, environment, ) if client_id.nil? || client_secret.nil? raise CheckoutArgumentException, 'Invalid OAuth "client_id" or "client_secret"' end return unless environment.nil? && .nil? raise CheckoutArgumentException, 'Invalid configuration. Please specify an "environment" or a specific OAuth "authorization_uri"' end end |
#log ⇒ Object
Returns the value of attribute log.
19 20 21 |
# File 'lib/checkout_sdk/oauth_sdk_credentials.rb', line 19 def log @log end |
#scopes ⇒ Array(CheckoutSdk::OAuthScopes)
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/checkout_sdk/oauth_sdk_credentials.rb', line 18 class OAuthSdkCredentials < SdkCredentials attr_accessor :access_token, :client_id, :client_secret, :scopes, :http_client, :environment, :authorization_uri, :log # @param [String] client_id # @param [String] client_secret # @param [Array(CheckoutSdk::OAuthScopes)] scopes # @param [Faraday::Connection] http_client # @param [CheckoutSdk::Environment] environment # @param [String, nil] auth_uri def initialize(client_id, client_secret, scopes, http_client, environment, logger, auth_uri = nil) validate_arguments client_id, client_secret, environment, auth_uri @client_id = client_id @client_secret = client_secret @scopes = scopes @authorization_uri = auth_uri.nil? ? environment. : auth_uri @oauth_http_client = http_client.clone @oauth_http_client.url_prefix = @authorization_uri @log = logger build_access_token end # @param [String] authorization_type # @return [CheckoutSdk::SdkAuthorization] def () case when AuthorizationType::SECRET_KEY_OR_OAUTH, AuthorizationType::PUBLIC_KEY_OR_OAUTH, AuthorizationType::OAUTH SdkAuthorization.new(PlatformType::DEFAULT, build_access_token.token) else raise CheckoutAuthorizationException. end end # @return [CheckoutSdk::OAuthAccessToken] def build_access_token return @access_token unless @access_token.nil? || @access_token.token.nil? || !@access_token.valid? data = { client_id: @client_id, client_secret: @client_secret, grant_type: 'client_credentials', scope: @scopes.join(' ') } headers = { 'Content-Type': 'application/x-www-form-urlencoded' } body = URI.encode_www_form data begin @log.info "post: #{}" response = @oauth_http_client.run_request(:post, @authorization_uri, body, headers) rescue Faraday::ClientError => e raise CheckoutAuthorizationException, e.response rescue Faraday::ConnectionFailed => e raise CheckoutArgumentException, e.wrapped_exception end if !response.body.nil? && response.body != '' oauth_response = JSON.parse(response.body, object_class: OpenStruct) @access_token = OAuthAccessToken.new(oauth_response.access_token, Time.now + oauth_response.expires_in) end @access_token end private # @param [String] client_id # @param [String] client_secret # @param [Environment] environment # @param [String, nil] authorization_uri def validate_arguments(client_id, client_secret, environment, ) if client_id.nil? || client_secret.nil? raise CheckoutArgumentException, 'Invalid OAuth "client_id" or "client_secret"' end return unless environment.nil? && .nil? raise CheckoutArgumentException, 'Invalid configuration. Please specify an "environment" or a specific OAuth "authorization_uri"' end end |
Instance Method Details
#build_access_token ⇒ CheckoutSdk::OAuthAccessToken
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/checkout_sdk/oauth_sdk_credentials.rb', line 58 def build_access_token return @access_token unless @access_token.nil? || @access_token.token.nil? || !@access_token.valid? data = { client_id: @client_id, client_secret: @client_secret, grant_type: 'client_credentials', scope: @scopes.join(' ') } headers = { 'Content-Type': 'application/x-www-form-urlencoded' } body = URI.encode_www_form data begin @log.info "post: #{}" response = @oauth_http_client.run_request(:post, @authorization_uri, body, headers) rescue Faraday::ClientError => e raise CheckoutAuthorizationException, e.response rescue Faraday::ConnectionFailed => e raise CheckoutArgumentException, e.wrapped_exception end if !response.body.nil? && response.body != '' oauth_response = JSON.parse(response.body, object_class: OpenStruct) @access_token = OAuthAccessToken.new(oauth_response.access_token, Time.now + oauth_response.expires_in) end @access_token end |
#get_authorization(authorization_type) ⇒ CheckoutSdk::SdkAuthorization
48 49 50 51 52 53 54 55 |
# File 'lib/checkout_sdk/oauth_sdk_credentials.rb', line 48 def () case when AuthorizationType::SECRET_KEY_OR_OAUTH, AuthorizationType::PUBLIC_KEY_OR_OAUTH, AuthorizationType::OAUTH SdkAuthorization.new(PlatformType::DEFAULT, build_access_token.token) else raise CheckoutAuthorizationException. end end |