libgdx / gdx-pay

A libGDX cross-platform API for InApp purchasing.
Apache License 2.0
225 stars 83 forks source link

Feature request: Allow using setObfuscatedAccountId and setObfuscatedProfileId in BillingFlowParams builder #228

Closed lucas-kakele closed 3 years ago

lucas-kakele commented 3 years ago

Google advises you to use setObfuscatedAccountId and setObfuscatedProfileId in BillingFlowParams builder to help fighting fraudulent transactions.

https://developer.android.com/google/play/billing/security#fraud

I checked the code and BillingFlowParams is currently not exposed: https://github.com/libgdx/gdx-pay/blob/d901a46a1f6ac5af916dc4109302c1f2a31b0fd8/gdx-pay-android-googlebilling/src/com/badlogic/gdx/pay/android/googlebilling/PurchaseManagerGoogleBilling.java#L234

I'm filing this feature request in order to make it available to users so we can set these params.

PS: Probably there is something for iOS as well, but I didn't look. Ideally, the solution should cover for any platform.

Let me know if you need more details. Thanks!

MrStahlfelge commented 3 years ago

We all mantain gdx-pay for our own projects, so we add the features we need. Apparently no one needed this before - so best was if you fork the repo, implement the feature as you need it and open a PR to add it.

As this seems to be a constant field not needed to be changed while the game is running, I suggest to use setter methods to set the obfuscated fields to the Billing PurchaseManager. This way, we don't need a cross-platform solution.

lucas-kakele commented 3 years ago

Hey MrStahlfelge. Thanks for your answer.

Awesome! I created the pull request above. Let me know your thoughts on it.

Regards.

MrStahlfelge commented 3 years ago

231 adds a way to set the fields