Manage in-app purchases for Apple AppStore and Google Play
Project description
# inapp-purchases
Manage in-app purchases for Apple AppStore and Google Play
[](https://badge.fury.io/py/inapp-purchases)
[](https://landscape.io/github/adanmauri/inapp-purchases/master)
## Installation
```shell
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:
```python
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:
```python
from inapp_purchases.app_store import AppStoreService
service = AppStoreService(
sandbox=True,
password='secret-password'
)
purchase = service.get_subscription_purchase(
receipt_data='receive-hash'
)
```
## Response
```python
{
'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
Manage in-app purchases for Apple AppStore and Google Play
[](https://badge.fury.io/py/inapp-purchases)
[](https://landscape.io/github/adanmauri/inapp-purchases/master)
## Installation
```shell
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:
```python
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:
```python
from inapp_purchases.app_store import AppStoreService
service = AppStoreService(
sandbox=True,
password='secret-password'
)
purchase = service.get_subscription_purchase(
receipt_data='receive-hash'
)
```
## Response
```python
{
'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.4.0.tar.gz
(4.9 kB
view details)
Built Distributions
File details
Details for the file inapp-purchases-0.4.0.tar.gz
.
File metadata
- Download URL: inapp-purchases-0.4.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.12.4 setuptools/33.1.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
58034ba5d367f21439c83e023904c3a4911e1a1edad0598ba2928c49264409d7
|
|
MD5 |
a988d70e17696fe8c92caa1829e08897
|
|
BLAKE2b-256 |
8943b89c4f3a49948efb1fed3e25fa8a61b46cecd5beec19b0a2e8e501dcd42a
|
File details
Details for the file inapp_purchases-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: inapp_purchases-0.4.0-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.12.4 setuptools/33.1.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
0689554afc19093d4d039f09365526629704af136bd4a5fe2c25710ba85aa038
|
|
MD5 |
6c951e0547930d897e1b73c155af8f1d
|
|
BLAKE2b-256 |
2f321825bf04c3f514b94e7ee1c2af08d41c042ef7cec461ae80458d176ceb82
|
File details
Details for the file inapp_purchases-0.4.0-py2-none-any.whl
.
File metadata
- Download URL: inapp_purchases-0.4.0-py2-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.12.4 setuptools/33.1.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
a0f8845793af2649485a7f5fc407c4870edbc7c472eed3ab4f0384a86a6d0d71
|
|
MD5 |
0861c2f6cca19149bc17fe292b9285b0
|
|
BLAKE2b-256 |
26985ae08c7c79451a155303995c0a56c17dc07d42b70d9516933bb1b48bcbd6
|