Skip to main content

Apple iTunes In-app purchase verification api.

Project description

itunes-iap
~~~~~~~~~~

Quick example
-------------

Create request to create a request to itunes verify api.

>>> from itunesiap import Request, InvalidReceipt
>>> request = Request(raw_data) # base64-encoded data
>>> try:
>>> receipt = request.verify()
>>> except InvalidReceipt as e:
>>> print 'invalid receipt'
>>> print receipt.product_id # any other values are available as property!

Practical useful values are: product_id, original_transaction_id, quantity, unique_identifier

Quick example with password (Apple Shared Secret)
-------------

Create request to create a request to itunes verify api.

>>> from itunesiap import Request, InvalidReceipt
>>> request = Request(raw_data, password) # base64-encoded data
>>> try:
>>> receipt = request.verify()
>>> except InvalidReceipt as e:
>>> print 'invalid receipt'
>>> print receipt.product_id # any other values are available as property!
>>> print receipt.latest_receipt # Get the latest receipt returned by Apple


Verification policy
-------------------

Set verification mode for production or sandbox api. Review mode also available for appstore review.

>>> from itunesiap import Request
>>> with request.verification_mode('review'): # enable both production and sandbox for appstore review. 'production', 'sandbox' or 'review'
>>> receipt = Request(raw_data).verify()

Workflow Shortcut
-----------------

>>> def test_paid(original_transaction_id):
>>> if db.contains(original_transaction_id):
>>> raise CustomException # custom exception
>>>
>>> import itunesiap
>>> try:
>>> response = itunesiap.verify(raw_data, test_paid)
>>> except itunesiap.RequestError:
>>> pass
>>> except CustomException:
>>> pass
>>> # response is instance of `itunesiap.core.Response`


Forked from https://github.com/youknowone/itunes-iap

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

itunes-iap2-0.6.2.2.tar.gz (5.2 kB view details)

Uploaded Source

Built Distributions

itunes_iap2-0.6.2.2-py2.7.egg (5.0 kB view details)

Uploaded Source

File details

Details for the file itunes-iap2-0.6.2.2.tar.gz.

File metadata

File hashes

Hashes for itunes-iap2-0.6.2.2.tar.gz
Algorithm Hash digest
SHA256 7186c32dc0c0ed8e83a4fef49428f50c37c86c64818e5487585065645fca0670
MD5 af43d26b6d5dd241b7c1ebac79b1fd09
BLAKE2b-256 b9dbc1735536864e49252116d238477371d4687d35d2f82d18d1a1553e08cb20

See more details on using hashes here.

File details

Details for the file itunes_iap2-0.6.2.2-py2.7.egg.

File metadata

File hashes

Hashes for itunes_iap2-0.6.2.2-py2.7.egg
Algorithm Hash digest
SHA256 277caefbdd8aadb46702add1d4a90173e9a5820b1b68f7948ba26764093eb67a
MD5 27a2a450c4734fb2cdd3e1dd9f66b3a5
BLAKE2b-256 dd8db0a1de8f02376c52b55643018213cc32e4e76f1a9cf01ef8ee5e5d95910c

See more details on using hashes here.

File details

Details for the file itunes-iap2-0.6.2.2.macosx-10.10-x86_64.tar.gz.

File metadata

File hashes

Hashes for itunes-iap2-0.6.2.2.macosx-10.10-x86_64.tar.gz
Algorithm Hash digest
SHA256 b41a66529d9e2c90171db3371a6036b24e4668c761dec1b046e41da55ed83ede
MD5 b9c438a57224de1611d5f413fff9ba44
BLAKE2b-256 c38e9e463bdf3200a6f359248364433816d41c8d0b2f042ad63411fc3f00129b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page