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_verifier import GogglePurchaseProductVerifier

google_verifier = GogglePurchaseProductVerifier("google api.json")

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

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

print(data)

consume purchase

from google_purchase_verifier import GogglePurchaseProductVerifier

google_verifier = GogglePurchaseProductVerifier("google api.json")

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

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

print(data)

acknowledge purchase

from google_purchase_verifier import GogglePurchaseProductVerifier

google_verifier = GogglePurchaseProductVerifier("google api.json")

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

data = google_verifier.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.2.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyinapp_purchase-0.0.2.tar.gz
  • Upload date:
  • Size: 4.2 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.2.tar.gz
Algorithm Hash digest
SHA256 a7cceb0e1f7e3779838f7905e6ca7653c93a2e6bf8483fdc8e79a925d8689f28
MD5 302b188b02ad9b2e401974d0219881d6
BLAKE2b-256 9013fa9857d2c57e7498bd188fd0ec6eace7e8b0daad4368134a7fef85bae166

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyinapp_purchase-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d7b4ddb977bd92cae301e5fc25ffe8e6628101d43752ccbdf8be0b1486564948
MD5 eacd7cd652379aa3244c88e58460414e
BLAKE2b-256 1652764d2faf26518d18abe60028470a790f7aec269504fb29f0aa9b65a99544

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