Exception: IAPVerifier::Error::InvalidReceiptData

Inherits:
Standard
  • Object
show all
Defined in:
lib/iap_verifier/error.rb

Constant Summary collapse

MESSAGES =
{
  21000 => "App store could not read",
  21002 => "Data was malformed",
  21003 => "Receipt not authenticated",
  21004 => "Shared secret does not match",
  21005 => "Receipt server unavailable",
  21006 => "Receipt valid but sub expired",
  21007 => "Sandbox receipt sent to Production environment",
  21008 => "Production receipt sent to Sandbox environment"
}

Instance Method Summary collapse

Constructor Details

#initialize(code) ⇒ InvalidReceiptData

Returns a new instance of InvalidReceiptData.



43
44
45
# File 'lib/iap_verifier/error.rb', line 43

def initialize(code)
  @code = code
end

Instance Method Details

#messageObject



47
48
49
50
51
52
# File 'lib/iap_verifier/error.rb', line 47

def message
  {
    error_code: @code,
    message: MESSAGES.fetch(@code, 'Unknown error code')
  }
end