Manage in-app purchases for Apple AppStore and Google Play
Project description
inapp-purchases
Manage in-app purchases for Apple AppStore and Google Play
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.0.tar.gz
(5.1 kB
view hashes)
Built Distributions
Close
Hashes for inapp_purchases-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6afb44de1d68d735abfcd27162ebde64726804a86580c40db2d46a7c29079eca |
|
MD5 | 1438a6ccc14783d6bab3d10f4f0a6ddd |
|
BLAKE2b-256 | 3cce21284ba59aa5ccc4057bb651851ac3375af896ffd7a291665e3aeb407435 |
Close
Hashes for inapp_purchases-0.3.0-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5a2183ae3dd01413dc9dbbcb887dc52f148f98688cdc907a570654ba4e95b1b |
|
MD5 | b95bd4385be3f4ea9393ee9cce2eab8f |
|
BLAKE2b-256 | 6de8139dac50844a2f9aca7f457610ea813c94f3336dc4a1552c1e529d87cb74 |