P
P
paleniy2018-09-16 15:41:13
Android
paleniy, 2018-09-16 15:41:13

android in-app. How to implement the ability to re-purchase the same product in the application?

Good afternoon!
I'm making a store in the app. I'm going to sell the same product more than once, but this is not a subscription - so I
created a limited product in the google console
. In the application for making a purchase, I use the Checkout library from this post https://habr.com/post/233265/.
The library has a check for the type of product: if the type is in-app, and this product has already been bought, then we get the ITEM_ALREADY_OWNED error (as I understand it, in this case, a purchase request was not sent to Google)
Changed the type to subscription (SUBSCRIPTION) - a request occurs in Google, but Google also returns a message that such a product has already been bought

requests.purchase(ProductTypes.SUBSCRIPTION, "ptoduct", null, mCheckout.getPurchaseFlow());

Google's limited product is not allowed to be purchased more than once, and the subscription is not suitable for multiple purchases in a short period of time
Q:
How can I buy the same product several times?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
paleniy, 2018-09-16
@paleniy

I looked for an answer in other words - it looks like you need to use consume

G
GavriKos, 2018-09-16
@GavriKos

After you have accrued the purchase - a specific payment must be "closed" - alas, I will not say the name of the method. Until then, it will not be available for repurchase.
A workflow like this:
The user clicks "buy" - we kick the payment system - the payment system is moving something there, the user spends money in it - the payment system pulls the callback of our application about a successful purchase - we accrue what we bought in our application (internal currency in game, for example) - we tell the payment card that "everything is OK, we charged"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question