简体   繁体   English

将 google play 计费库更新到版本 2 不起作用,购买总是退款

[英]Updating google play billing library to version 2 is not working, purchase is always refunded

I had a functioning Android implementation in-app billing, using the billing client 1.0.2 library and everything worked fine.我有一个正常运行的 Android 实现应用内计费,使用计费客户端 1.0.2 库,一切正常。 I have a simple premium upgrade, without subscriptions.我有一个简单的高级升级,没有订阅。

Now I tried to upgrade to 2.0.3, I made all the necessary changes to my code (using official documentation, release notes, and StackOverflow) and it doesn't work.现在我尝试升级到 2.0.3,我对我的代码进行了所有必要的更改(使用官方文档、发行说明和 StackOverflow)但它不起作用。 I know I must recognize all purchases within three days.我知道我必须在三天内确认所有购买。 Failure to correctly recognize purchases will result in reimbursement for these purchases.未能正确识别购买将导致这些购买的报销。 And that's what I did.这就是我所做的。

The entire purchase workflow looks okay, the behavior is like before the library is updated.整个购买工作流程看起来不错,行为就像库更新之前一样。 But in the end my purchase is always refunded after 5 minutes (using a trial account, so it's 5 minutes instead of 3 days).但最后我的购买总是在 5 分钟后退款(使用试用帐户,所以是 5 分钟而不是 3 天)。

this is inside onPurchasesUpdated:这是在 onPurchasesUpdated 里面:

     if (purchase.getPurchaseState() == Purchase.PurchaseState.PURCHASED) {
        if (!purchase.isAcknowledged()) {

            AcknowledgePurchaseParams acknowledgePurchaseParams = AcknowledgePurchaseParams.newBuilder().setPurchaseToken(purchase.getPurchaseToken()).build();

            AcknowledgePurchaseResponseListener acknowledgePurchaseResponseListener = new AcknowledgePurchaseResponseListener() {
                @Override
                public void onAcknowledgePurchaseResponse(BillingResult billingResult) { 
                    Toast.makeText(getContext(), "Purchase acknowledged", Toast.LENGTH_LONG);
                }
            };

            mBillingClient.acknowledgePurchase(acknowledgePurchaseParams, acknowledgePurchaseResponseListener);
        }
    }

The debugger performs recognition and in onAcknowledgePurchaseResponse, I can see that my billingResult response code is 5 (developer error), the debug message is empty.调试器执行识别,在 onAcknowledgePurchaseResponse 中,我可以看到我的 billingResult 响应代码为 5(开发人员错误),调试消息为空。 And I have no idea what's wrong.而且我不知道出了什么问题。 Please, someone can help me find out what's missing.拜托,有人可以帮我找出缺少的东西。 Many thanks!非常感谢!

After updating the billing client library to 3.0.0 everything works fine!将计费客户端库更新到 3.0.0 后一切正常!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何混淆 Google Play Billing Library 版本 4 中的 Purchase 和 SkuDetails? - How to obfuscate Purchase and SkuDetails in Google Play Billing Library version 4? Android Google Play Billing Library v2/v3:如何阻止某人恶意阻止确认并因此获得退款? - Android Google Play Billing Library v2/v3: How to stop someone maliciously preventing an acknowledgement and therefore get their purchase refunded? 将 google play 计费库更新到版本 3,行为令人困惑 - Updating google play billing library to version 3 with confusing behavior Google 应用内购买始终会获得退款 - Google In-App Purchase are always refunded 如何实现 google play billing library version 4? - How to implement google play billing library version 4? 实施 Google Play 结算库版本 2 - Implement Google Play Billing Library version 2 购买Android In App:未配置此版本的应用,以便通过Google Play计费 - Android In app purchase: This version of the application is not configured for billing through Google Play Google Play 结算库:确定基本计划/订阅购买到期 - Google Play Billing Library: Determine base plan / expiry of subscription purchase Google Play 结算库 3.0+ - 恢复购买 - Google Play Billing Library 3.0+ - Restore purchase 在谷歌播放计费库中成功购买后,谷歌播放计费购买结果显示空列表(原生安卓) - Google play billing purchase result shows empty list after a successful purchase in the google play billing library (Native android)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM