Class: CandyCheck::CLI::Commands::PlayStore

Inherits:
Base
  • Object
show all
Defined in:
lib/candy_check/cli/commands/play_store.rb

Overview

Command to verify an PlayStore purchase

Instance Method Summary collapse

Methods inherited from Base

run

Constructor Details

#initialize(package, product_id, token, options) ⇒ PlayStore

Prepare a verification run from the terminal

Parameters:

  • package (String)
  • product_id (String)
  • token (String)
  • options (Hash)

Options Hash (options):

  • :issuer (String)

    to use for API access

  • :key_file (String)

    to use for API access

  • :key_secret (String)

    to decrypt the key file

  • :application_name (String)

    for the API call

  • :application_version (String)

    for the API call



16
17
18
19
# File 'lib/candy_check/cli/commands/play_store.rb', line 16

def initialize(package, product_id, token, options)
  @package, @product_id, @token = package, product_id, token
  super(options)
end

Instance Method Details

#runObject

Print the result of the verification to the terminal



22
23
24
25
26
27
28
# File 'lib/candy_check/cli/commands/play_store.rb', line 22

def run
  verifier = CandyCheck::PlayStore::Verifier.new(config)
  verifier.boot!
  result = verifier.verify(@package, @product_id, @token)
  out.print "#{result.class}:"
  out.pretty result
end