Sha256: bf37ee11d57d46191279541b4446e07558d8815bab134059ce5f53c8faa56504

Contents?: true

Size: 969 Bytes

Versions: 11

Compression:

Stored size: 969 Bytes

Contents

module CandyCheck
  module CLI
    module Commands
      # Command to verify an AppStore receipt token
      class AppStore < Base
        # Prepare a verification run from the terminal
        # @param receipt [String]
        # @param options [Hash]
        # @option options [String] :secret A shared secret to use
        # @option options [String] :environment The environment to use
        def initialize(receipt, options)
          @receipt = receipt
          super(options)
        end

        # Print the result of the verification to the terminal
        def run
          verifier = CandyCheck::AppStore::Verifier.new(config)
          result = verifier.verify(@receipt, options[:secret])
          out.print "#{result.class}:"
          out.pretty result
        end

        private

        def config
          CandyCheck::AppStore::Config.new(
            environment: options[:environment].to_sym
          )
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
candy_check-0.5.0 lib/candy_check/cli/commands/app_store.rb
candy_check-0.4.0 lib/candy_check/cli/commands/app_store.rb
candy_check-0.3.0 lib/candy_check/cli/commands/app_store.rb
candy_check-0.2.1 lib/candy_check/cli/commands/app_store.rb
candy_check-0.2.0 lib/candy_check/cli/commands/app_store.rb
candy_check-0.1.2 lib/candy_check/cli/commands/app_store.rb
candy_check-0.1.1 lib/candy_check/cli/commands/app_store.rb
candy_check-0.1.0.pre lib/candy_check/cli/commands/app_store.rb
candy_check-0.0.5 lib/candy_check/cli/commands/app_store.rb
candy_check-0.0.3 lib/candy_check/cli/commands/app_store.rb
candy_check-0.0.2 lib/candy_check/cli/commands/app_store.rb