Exception: StoreKit::ValidationError
- Defined in:
- lib/storekit/error.rb
Instance Attribute Summary collapse
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
-
#initialize(status_code) ⇒ ValidationError
constructor
A new instance of ValidationError.
- #server_error? ⇒ Boolean
Constructor Details
#initialize(status_code) ⇒ ValidationError
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/storekit/error.rb', line 8 def initialize(status_code) @status_code = status_code = case status_code when 21000 then 'The App Store could not read the JSON object you provided.' when 21002 then 'The data in the receipt-data property was malformed or missing.' when 21003 then 'The receipt could not be authenticated.' when 21004 then 'The shared secret you provided does not match the shared secret on file for your account.' when 21005 then 'The receipt server is not currently available.' when 21006 then 'This receipt is valid but the subscription has expired.' when 21007 then 'This receipt is from the test environment, but it was sent to the production environment for verification.' when 21008 then 'This receipt is from the production environment, but it was sent to the test environment for verification.' else 'Unknown error' end super() end |
Instance Attribute Details
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
6 7 8 |
# File 'lib/storekit/error.rb', line 6 def status_code @status_code end |
Instance Method Details
#server_error? ⇒ Boolean
25 26 27 |
# File 'lib/storekit/error.rb', line 25 def server_error? [21004, 21007, 21008].include?(status_code) || == 'Unknown error' end |