ITunes IAP Receipt Analyzer & Validator
Validates iTunes In-App Purchase receipts with Apple and reports on status.
Installation
Add this line to your application's Gemfile:
gem 'itunes-iap'
And then execute:
$ bundle
Or install it yourself as:
$ gem install itunes-iap
Usage
require 'itunes/iap'
receipt = Itunes::IAP::Receipt.analyze(
base64_receipt_data,
shared_secret: shared_secret,
sandbox: true
)
Attributes
:status
is the status code returned by Apple during validation:response
is the raw response object from Apple:original_transaction_id
is the original transaction ID, useful for validating uniqueness among users:latest_transaction_id
is the most recent transaction ID:product_id
is the product ID the purchase covers:valid_until
is the expiration date of the purchase:valid
is true only when Apple validated the provided receipt and the expiration date is in the future
Contributing
- Fork it ( http://github.com/litehouselabs/itunes-iap/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request