Skip to main content

pyinapp_purchase is an open-source Python library designed to simplify and securely validate in-app purchase tokens server side.

Project description

pyinapp_purchase

pyinapp_purchase is an open-source Python library designed to simplify and securely validate, consume and acknowledge in-app purchase tokens server side. This library provides an efficient and straightforward way to handle token verification, consumption and acknowledgement making it easier to manage app transactions and ensure validity directly from your backend.

Service Account Private Key from Google Cloud is need, as json file.

Features

  • Seamless Integration: Quickly integrate the validator into existing Python applications.
  • Verification: Handles token verification directly with the Google Play Store API to ensure data authenticity.
  • Consumption: Handles token consumption if token wasn't consume client side.
  • Acknowledgement: Handles token acknowledgement.
  • Error Handling: Provides clear feedback for successful or failed token validations.
  • Lightweight and Performant: Minimal dependencies and optimized for fast, reliable performance.

Installation

pip install pyinapp-purchase

Usage

verifying purchase

from google_purchase import GooglePurchaseProduct

google_inapp = GooglePurchaseProduct("google api.json")

package_name = "com.example.app"
product_id = "first_product"
purchase_token = "token"

data = google_purchase.verify_purchase(package_name, product_id, purchase_token)

print(data)

consume purchase

from google_purchase import GooglePurchaseProduct

google_purchase = GooglePurchaseProduct("google api.json")

package_name = "com.example.app"
product_id = "first_product"
purchase_token = "token"

data = google_purchase.consume_purchase(package_name, product_id, purchase_token)

print(data)

acknowledge purchase

from google_purchase import GooglePurchaseProduct

google_purchase = GooglePurchaseProduct("google api.json")

package_name = "com.example.app"
product_id = "first_product"
purchase_token = "token"

data = google_purchase.acknowledge_purchase(package_name, product_id, purchase_token)

print(data)

Todo

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

pyinapp_purchase-0.0.4.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

pyinapp_purchase-0.0.4-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file pyinapp_purchase-0.0.4.tar.gz.

File metadata

  • Download URL: pyinapp_purchase-0.0.4.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.9

File hashes

Hashes for pyinapp_purchase-0.0.4.tar.gz
Algorithm Hash digest
SHA256 6ec56dd3de8ffd9fc6746edc1d12115dd002f8e4d0bf77ed178650ebb58f480c
MD5 d575761a0f53aea2000f1725e7f9228a
BLAKE2b-256 ea1b35eb4cf070ab67d43b235376df50de435460564d31b85f855caa7456f6ac

See more details on using hashes here.

File details

Details for the file pyinapp_purchase-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for pyinapp_purchase-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 25dac15d07ff39be7fbd9f08c050165fca6e257e5dc5d1600bac4d516829093e
MD5 842701454748d181e4b546aee8096143
BLAKE2b-256 c874d42d127e275ff4678d5b86268d025e2b56acc86660a56ea2a52dfd7be945

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