Sha256: 80f7fbb8fdadcf18ffe96b8537e10c420d14f66d8987975cd5e40d184d7faf98

Contents?: true

Size: 700 Bytes

Versions: 10

Compression:

Stored size: 700 Bytes

Contents

# frozen_string_literal: true

module SolidusBolt
  module Accounts
    class DetailService < SolidusBolt::BaseService
      attr_reader :access_token

      def initialize(access_token:)
        @access_token = access_token
        super
      end

      def call
        detail
      end

      private

      def detail
        options = build_options
        handle_result(
          HTTParty.get(
            "#{api_base_url}/#{api_version}/account",
            options
          )
        )
      end

      def build_options
        {
          headers: {
            'Authorization' => "Bearer #{access_token}",
          }.merge(authentication_header)
        }
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
solidus_bolt-0.7.2 app/services/solidus_bolt/accounts/detail_service.rb
solidus_bolt-0.7.1 app/services/solidus_bolt/accounts/detail_service.rb
solidus_bolt-0.7.0 app/services/solidus_bolt/accounts/detail_service.rb
solidus_bolt-0.6.0 app/services/solidus_bolt/accounts/detail_service.rb
solidus_bolt-0.5.0 app/services/solidus_bolt/accounts/detail_service.rb
solidus_bolt-0.4.0 app/services/solidus_bolt/accounts/detail_service.rb
solidus_bolt-0.3.0 app/services/solidus_bolt/accounts/detail_service.rb
solidus_bolt-0.2.0 app/services/solidus_bolt/accounts/detail_service.rb
solidus_bolt-0.1.0 app/services/solidus_bolt/accounts/detail_service.rb
solidus_bolt-0.0.1 app/services/solidus_bolt/accounts/detail_service.rb