Class: CandyCheck::AppStore::Verifier
- Inherits:
-
Object
- Object
- CandyCheck::AppStore::Verifier
- Defined in:
- lib/candy_check/app_store/verifier.rb
Overview
Verifies receipts against the verification servers. The call return either an Receipt or a VerificationFailure
Constant Summary collapse
- PRODUCTION_ENDPOINT =
HTTPS endpoint for production receipts
'https://buy.itunes.apple.com/verifyReceipt'- SANDBOX_ENDPOINT =
HTTPS endpoint for sandbox receipts
'https://sandbox.itunes.apple.com/verifyReceipt'- REDIRECT_TO_SANDBOX_CODE =
Status code from production endpoint when receiving a sandbox receipt which occurs during the app’s review process
21_007- REDIRECT_TO_PRODUCTION_CODE =
Status code from the sandbox endpoint when receiving a production receipt
21_008
Instance Attribute Summary collapse
-
#config ⇒ Config
readonly
The current configuration.
Instance Method Summary collapse
-
#initialize(config) ⇒ Verifier
constructor
Initializes a new verifier for the application which is bound to a configuration.
-
#verify(receipt_data, secret = nil) ⇒ Receipt, VerificationFailure
Calls a verification for the given input.
Constructor Details
#initialize(config) ⇒ Verifier
Initializes a new verifier for the application which is bound to a configuration
23 24 25 |
# File 'lib/candy_check/app_store/verifier.rb', line 23 def initialize(config) @config = config end |
Instance Attribute Details
#config ⇒ Config (readonly)
Returns the current configuration.
18 19 20 |
# File 'lib/candy_check/app_store/verifier.rb', line 18 def config @config end |
Instance Method Details
#verify(receipt_data, secret = nil) ⇒ Receipt, VerificationFailure
Calls a verification for the given input
32 33 34 35 36 37 38 39 |
# File 'lib/candy_check/app_store/verifier.rb', line 32 def verify(receipt_data, secret = nil) default_endpoint, opposite_endpoint = endpoints result = call_for(default_endpoint, receipt_data, secret) if should_retry?(result) return call_for(opposite_endpoint, receipt_data, secret) end result end |