Code Monkey home page Code Monkey logo

Comments (3)

 avatar commented on September 13, 2024

Thanks lorenx.

What would be the advantage of saving all test transactions with the same id?

from androidbillinglibrary.

lorenx avatar lorenx commented on September 13, 2024

let's see an example.

i first purchase my product:

requestPurchase("android.test.purchased")

and it stores productId="android.test.purchased", state=0;

then i request a refund:

requestPurchase("android.test.refunded")

and it stores productId="android.test.refunded", state=2;

in the end, isPurchased() method is ambiguous because if i call:

isPurchased("android.test.purchased")

it returns always true.

well, i just think that it has to be the "state" that store the state for the same productId.
am i wrong?

from androidbillinglibrary.

 avatar commented on September 13, 2024

Got it.

While this behavior would certainly be useful for testing, there's no documentation that says that test transactions should be treated like this and they're not treated like this in the official Android In-app Billing example (Dungeons). Thus, we think it's best to leave the identifiers of test transactions unmodified.

That said, isPurchased return true if the id has a purchased transaction and does not consider refunds or cancellations. We need to clarify this on the documentation and maybe add another method that does consider refunds and cancellations. Currently, finer-grain control of this can be achieved with getPurchases, but it's not optimal.

from androidbillinglibrary.

Related Issues (20)

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.