Skip to main content

Manage in-app purchases for Apple AppStore and Google Play

Project description

inapp-purchases

Manage in-app purchases for Apple AppStore and Google Play

PyPI version Code Health

Installation

pip install inapp-purchases

Usage

Currently inapp-purchases supports Google Play and App Store subscription services. But, product purchases is available retrieving raw data.

Google Play:

from inapp_purchases.google_play import GooglePlayService

service = GooglePlayService(
    service_account_file='service-info.json',
    # or service_account_info='service-info.json'
    package_name='com.package.name'
)

purchase = service.get_subscription_purchase(
    subscription_id='com.subscription.id',
    token='purchase-token'
)

AppStore:

from inapp_purchases.app_store import AppStoreService

service = AppStoreService(
    sandbox=True,
    password='secret-password'
)

purchase = service.get_subscription_purchase(
    receipt_data='receive-hash'
)

Response

{
    'bundle_id': unicode,
    'subscription_id': unicode,
    'purchase_id': unicode,
    'original_purchase_id': unicode,
    'purchase_date_ms': int,
    'original_purchase_date_ms': int,
    'auto_renewing': bool,
    'expires_date_ms': int,
    'country_code': unicode,
    'price_currency_code': unicode,
    'price_amount': float,
    'cancellation_date_ms': int,
    'cancellation_reason': unicode,,
    'payment_state': int,
    'status': unicode,
    'is_active': bool,
    'is_trial_period': bool,
    'expiration_intent': unicode,
}

TODO

  • Exceptions
  • Google Play products data response (the raw content is returned)
  • AppStore products data response (the raw content is returned)
  • Get list of products from AppStore
  • Tests
  • Retrieve more information from the services
  • Documentation
  • Examples

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

inapp-purchases-0.3.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distributions

inapp_purchases-0.3.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

inapp_purchases-0.3.1-py2-none-any.whl (6.7 kB view details)

Uploaded Python 2

File details

Details for the file inapp-purchases-0.3.1.tar.gz.

File metadata

  • Download URL: inapp-purchases-0.3.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.15

File hashes

Hashes for inapp-purchases-0.3.1.tar.gz
Algorithm Hash digest
SHA256 b573e1ea03b0afb7a6af5fe01549aa3808704971ddccc6144ff53832052f9057
MD5 78ad39144f8eedd6c86011c4d7f04c45
BLAKE2b-256 b9f3c7f39d7f63f79d925cd26cfc33de28cdbb88c8bcd241bc89d55d189726c8

See more details on using hashes here.

File details

Details for the file inapp_purchases-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: inapp_purchases-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.15

File hashes

Hashes for inapp_purchases-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cdfd0d738b1cc69b07a59555f07735c9f72774e941c3ee253878172b121b3cdb
MD5 81281c5bfa3a87c092f9cfddc6f7743d
BLAKE2b-256 100a8a2c6327a032da83d86bc658fbdc8cda334dd77958b5aede2077e3210c6d

See more details on using hashes here.

File details

Details for the file inapp_purchases-0.3.1-py2-none-any.whl.

File metadata

  • Download URL: inapp_purchases-0.3.1-py2-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.15

File hashes

Hashes for inapp_purchases-0.3.1-py2-none-any.whl
Algorithm Hash digest
SHA256 bc70c30e860bfdfe6e979049a1a87502464f03b4ebe480b8ee4641be8e4075a7
MD5 edd9353e17e0285f3630716cc9834b67
BLAKE2b-256 b9183af20869c52b55af9a7f2d83b85f7fa5cb31124f8a3739c0c481dbc3cc51

See more details on using hashes here.

Supported by

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