2012-04-24 39 views
0

上周,我做了一系列测试内购买应用,一切进展顺利。不过,我在结帐时取消了我的命令,因为这样,谷歌播放会不停地发送取消通知。应用内结算:确认退款通知

显然googleplay不理解我的确认,并在连续循环中通知我。

在onPurchaseStateChanged

,JSON解析后:

ArrayList<String> confirmations = new ArrayList<String>(); 

for (Trans p : transactions) 
{ 
    [...] 
    if (p.purchaseState.ordinal() == PurchaseState.CANCELLED.ordinal()) 
     confirmations.add(p.notificationId); 
} 
if (!confirmations.isEmpty()) 
{ 
    final String[] notifyIds = confirmations.toArray(new String[confirmations.size()]); 
    confirmNotifications(context, notifyIds); 
} 

public static void confirmNotifications(Context context, String[] notifyIds) 
{ 
    final Intent intent = createIntent(context, Action.CONFIRM_NOTIFICATIONS); 
    intent.putExtra(EXTRA_NOTIFY_IDS, notifyIds); 
    context.startService(intent); 
} 

我做错了什么?

回答

0

你想从这里开始什么服务?你自己?最终,您需要绑定到Market/Play商店的结算服务,并拨打sendBillingRequest()并填写正确的Bundle。你的代码是否这样做?

+0

是的,我没有任何问题与同样的方法购买确认 – 2012-04-25 07:19:23

+0

好吧,似乎是由于我的工作俘虏网络/代理。在家取消通知被确认没有问题。另一方面,我不明白为什么确认购买确认但不取消确认(在工作中) – 2012-04-25 07:42:47