Android Purchase Multiple Products In InAppBilling

一笑奈何 提交于 2021-02-07 08:20:11

问题


I am using android InAppBilling to purchase the products in my Application. I'm following the documentation on https://developer.android.com/google/play/billing/billing_integrate.html

According to the documentation we can buy only one product at a time.

Bundle buyIntentBundle = mService.getBuyIntent(3, getPackageName(),
   sku, "inapp", "bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ");

But in my android application, i have an option to buy All In-App-Purchases. So my question is how can i implement this functionality of buying all the products at the same time?.

First i thought of to add a product of All In-App-Purchases in the Play Store and the buy this product like the normal product.
But here is the disadvantage according to user perspective
1. Suppose i have 10 products in my app which the user can buy one by one and an option to buy all the products at the same time.
2. User bought a product say product1 in my app.
3. After some days user decided to buy all the products and he/she click the All In-App-Purchases button.
4. And the user successfully bought all the products. But the user is paying the money twice for the product product1.

So this is not the good approach. Kindly share your ideas or thoughts how i'll implement or proceed with this functionality of buying multiple products.
Thanks.


回答1:


If your products have the same price you may use 10 products like this:

1. products10 -> price * 10 items;
2. products9 -> price * 9 items;
...

It works bad with different charge for every product, because of multiple combinations that would be tedious to handle with price change. Still you may automate the process with Google Play Developer API and any scripting language.

Another solution is to use refund of products that had already bought. This road is more trickier because you cannot use the API to issue refunds and you must do this manually through your Google payments merchant account.



来源:https://stackoverflow.com/questions/39754164/android-purchase-multiple-products-in-inappbilling

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!