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".freeze
- SANDBOX_ENDPOINT =
HTTPS endpoint for sandbox receipts
"https://sandbox.itunes.apple.com/verifyReceipt".freeze
- 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.
-
#verify_subscription(receipt_data, secret = nil, product_ids = nil) ⇒ ReceiptCollection, Verification
Calls a subscription 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 |
# File 'lib/candy_check/app_store/verifier.rb', line 32 def verify(receipt_data, secret = nil) fetch_receipt_information(Verification, [receipt_data, secret]) end |
#verify_subscription(receipt_data, secret = nil, product_ids = nil) ⇒ ReceiptCollection, Verification
Calls a subscription verification for the given input
42 43 44 45 |
# File 'lib/candy_check/app_store/verifier.rb', line 42 def verify_subscription(receipt_data, secret = nil, product_ids = nil) args = [receipt_data, secret, product_ids] fetch_receipt_information(SubscriptionVerification, args) end |