【问题标题】:Purchase an item repeatedly through google wallet in android在安卓中通过谷歌钱包重复购买商品
【发布时间】:2015-07-20 11:01:20
【问题描述】:

我正在开发一个应用程序,我需要在其中购买特定时间的可用门票,例如一张下午 4 点到 8 点的门票,价格为 5 美元。我试图将谷歌集成到应用程序购买中,但它现在允许购买和购买项目。请让我知道是否可以通过谷歌钱包或建议我另一种方式。

【问题讨论】:

  • 您可以使用 Google Play Developer API 再编写一个 java 应用程序。以编程方式添加可购买的项目。 developers.google.com/android-publisher
  • 谢谢@MetehanToksoy,你的意思是说一旦买了票,我就应该在play store中添加一张带有diff id的票,然后用那个id来购买?
  • 您将在您的测试设备上试用它。

标签: android android-pay


【解决方案1】:

在花了这么多时间之后,我找到了这个解决方案。我可以通过这个得到旧的购买

Bundle ownedItems = mService.getPurchases(3, getPackageName(), "inapp", null);

然后我可以消费这些物品并让它们免费供下次购买。消耗物品

int response = mService.consumePurchase(3, getPackageName(), token);

参考:
https://developer.android.com/google/play/billing/billing_integrate.html

【讨论】:

    猜你喜欢
    • 2013-06-13
    • 2014-01-12
    • 1970-01-01
    • 2013-12-15
    • 2013-07-07
    • 1970-01-01
    • 1970-01-01
    • 2014-02-27
    • 2020-12-05
    相关资源
    最近更新 更多