Skip to main content

This Django app created for check response token that taken from Google Play or Bazaar is valid or not . and choice with method you want to confirm your purchase with that.

Project description

Google Play and Bazaar in-app purchase

This Django app created to check the response token that is taken from Google Play or Bazaar is valid or not. and choice with the method you want to confirm your purchase with that.

STEP 1

Install

  1. pip install django-google-bazaar-payment
  2. pip install requests
  3. Add "google_bazaar_payment" to your INSTALLED_APPS setting like this:
    INSTALLED_APPS = [
        ...
        'google_bazaar_payment',
    ]
  1. Run python manage.py migrate to create the google_bazaar_payment models

STEP 2

Google Play Implementation

  1. you must add GOOGLE_BUNDLE_ID to your project settings like this:
	GOOGLE_BUNDLE_ID = "com.package.android"
  1. Go to Django admin panel and in the payment section add a new record with information that you got from this link: Authorization
  2. Set the field type in the record you created to Google Play
  3. init token in record is the first token and initializer token that you took from the top link and this will use just one time .

STEP 3 For Bazaar Users

Bazaar Implementation

  1. you must add BAZAAR_BUNDLE_ID to your project settings like this:
	BAZAAR_BUNDLE_ID = "com.package.android"
  1. Go to Django admin panel and in the payment section add a new record with information that you got from this link : Authorization
  2. Set the field type in the record you created to Bazaar
  3. init token in record is the first token and initializer token that you took from the top link and this will use just one time. .

STEP 4 How to use

from google_bazaar_payment.payment.google_bazaar_payment import GBPayment

result = GBPayment.check_purchased_token(token="token that you received from server", product_id="product_id", type=0)
# type = 0 google play
# type = 1 Bazaar
if result:
    print("token is valid")
else:
    print("token is not valid OR there is an error if you get error you will see it in logs")
Copyright 2020 MiladNalbandi

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

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

django-google-bazaar-payment-1.2.tar.gz (9.7 kB view hashes)

Uploaded Source

Built Distribution

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