Git Product home page Git Product logo

pyinapp's People

Contributors

alej0varas avatar hasanino avatar keeprocking avatar krivyjan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pyinapp's Issues

validate_signature(googleplay) Unable to accept purchase data signature

I am trying to verify the product purchased from google play with the Google Play (receipt + signature) method, but validate_signature function does not accept the "signature" transmitted by google play by warning "Bad signature".

Same library is working to verify purchases in AppStore but not working in Google Play!

Do you have any idea why? @keeprocking

Validating Google Play Receipt

Google has an api to validate receipt. In pyinapp, for Google play receipt validation, no API call is used. Is it valid method or we should use API for google play case?

google in-app purchases validation | reciept json structure

@keeprocking,

for google in-app purchase validation using following receipt structure. it contains more keys than in your test file receipt.

please guide me what structure to follow and necessary keys to pass in json format.

{
  "data": {
    "orderId": "587741.91766670682",
    "packageName": "com.game.pkg",
    "productId": "life_3",
    "purchaseTime": 1464695120669,
    "purchaseState": 0,
    "developerPayload": "351",
    "purchaseToken": "oofmvnfsnosqrtelxvc"
  },
  "signature": "QiqvGGww82SLj4lAWpl7kodOXY5yIbj7aC9jc7g770PrEBD8cVmun1ayPyTEWPHvXTcIebHhlEXz24FSSGh62paIvFVP8hWquxyQgjqWZ09DbxFjIxML23PORyA7sjgSBYfi/g/p6XVBr/63eNqLqXXkRJX/TNtioKHY/DXU4ohW3f2AnEYrnkUjWGB5y6mS83w1/8Fu5rMad"
}

Validation Always Fails

Hello.

I'm just trying your library to verify receipt that is sent from Android device.

I've set everything and I bought an item with my friends' smartphone.

The problem is that it always fails to validate.

I found that verify() in pkcs1.py always fails because expected != clearsig.

Could you give any advice for this?

Thank you very much.

bundle_id = '...'
api_key = 'PUBLIC_KEY_FROM_GOOGLE_PLAY_DEVELOPER_CONSOLE'
validator = GooglePlayValidator(bundle_id, api_key)

try:
    receipt = {
        'orderId': '...',
        'packageName': '...',
        'productId': '...',
        'purchaseTime': ...,
        'purchaseState': ...,
        'developerPayload': '...',
        'purchaseToken': '...'
    }
    receipt = json.dumps(receipt)    # if not, error during encode()
    signature = 'abcdefg...'
    purchase = validator.validate(receipt, signature)
    print(True)     # never met this
except InAppValidationError:
    print(False)    # always reached here

Android validation does not work

The library needs some kind of API key for Android validation, though I only have p12 permission file, so it fails on setup.

What should i do?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.