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_purchase = 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.5.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyinapp_purchase-0.0.5.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.5.tar.gz
Algorithm Hash digest
SHA256 ad5cfd52ebf2c0834fccd7538776d4f451cce2896061cda7a5ff8076180fcdb6
MD5 38aa7d8bb3df2782d8d0e39e540da41e
BLAKE2b-256 327843263cd4256224755f5a14aab7f43972dab35789a0de7106595004bc9680

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyinapp_purchase-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 edd12c78eb2f497a70c57eefc00c02627974c251c969d1f4d67d4e8702f667e7
MD5 1ce4e1aca17e2913417a979cab4dcc3e
BLAKE2b-256 a007e0a076d3cb3f43d39b7092a23d6e19dcbf42ae655d5e203612190c2b3d58

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