Exception: Venice::Receipt::VerificationError
- Inherits:
-
StandardError
- Object
- StandardError
- Venice::Receipt::VerificationError
- Defined in:
- lib/venice/receipt.rb
Instance Attribute Summary collapse
-
#json ⇒ Object
Returns the value of attribute json.
Instance Method Summary collapse
- #code ⇒ Object
-
#initialize(json) ⇒ VerificationError
constructor
A new instance of VerificationError.
- #message ⇒ Object
- #retryable? ⇒ Boolean
Constructor Details
#initialize(json) ⇒ VerificationError
Returns a new instance of VerificationError.
148 149 150 |
# File 'lib/venice/receipt.rb', line 148 def initialize(json) @json = json end |
Instance Attribute Details
#json ⇒ Object
Returns the value of attribute json.
146 147 148 |
# File 'lib/venice/receipt.rb', line 146 def json @json end |
Instance Method Details
#code ⇒ Object
152 153 154 |
# File 'lib/venice/receipt.rb', line 152 def code Integer(json['status']) end |
#message ⇒ Object
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/venice/receipt.rb', line 160 def case code when 21000 'The App Store could not read the JSON object you provided.' when 21002 'The data in the receipt-data property was malformed.' when 21003 'The receipt could not be authenticated.' when 21004 'The shared secret you provided does not match the shared secret on file for your account.' when 21005 'The receipt server is not currently available.' when 21006 'This receipt is valid but the subscription has expired. When this status code is returned to your server, the receipt data is also decoded and returned as part of the response.' when 21007 'This receipt is a sandbox receipt, but it was sent to the production service for verification.' when 21008 'This receipt is a production receipt, but it was sent to the sandbox service for verification.' when 21010 'This receipt could not be authorized. Treat this the same as if a purchase was never made.' when 21100..21199 'Internal data access error.' else "Unknown Error: #{code}" end end |
#retryable? ⇒ Boolean
156 157 158 |
# File 'lib/venice/receipt.rb', line 156 def retryable? json['is_retryable'] end |