从我的服务器发出verifiyng android应用内购买(计费)测试请求时出现错误。我使用以下产品之一(https://developer.android.com/google/play/billing/billing_testing#billing-testing-static):
有三个保留的产品ID,用于测试静态Google Play结算响应:
android.test.purchased
当您使用此产品ID发出Google Play结算请求时,Google Play会以成功购买商品的方式进行响应。响应包含一个JSON字符串,其中包含伪造的购买信息(例如,伪造的订单ID)。android.test.canceled
当您使用此产品ID发出Google Play结算请求时,Google Play会做出响应,好像购买已被取消。当在订购过程中遇到错误(例如无效的信用卡)时,或者在向用户收取费用之前取消用户的订购时,可能会发生这种情况。android.test.item_unavailable
当您使用此产品ID提出Google Play结算请求时,Google Play会做出响应,好像购买的商品未列在您应用的产品列表中
我按照描述(https://developers.google.com/android-publisher/api-ref/purchases/products/get)发出GET HTTP请求:
GET https://www.googleapis.com/androidpublisher/v3/applications/com.gigantic.clawee/purchases/products/android.test.purchased/tokens/inapp:com.gigantic.clawee:android.test.purchased?access_token=<MY_ACCESS_TOKEN>
Run Code Online (Sandbox Code Playgroud)
但收到错误消息:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalid",
"message": "Invalid Value"
}
],
"code": 400,
"message": "Invalid Value"
}
}
Run Code Online (Sandbox Code Playgroud)
我做错什么了?请帮忙。一世
我们的应用程序有应用内购买功能。我们的测试对于真实的支付方式也运行良好,但我们不断收到来自国外客户(特别是亚洲)的错误报告。Google Play Billing Android 库返回响应代码BILLING_RESPONSE_RESULT_BILLING_UNAVAILABLE(3)。数十名用户尝试购买,但几乎没有人成功。
该代码仅使用以下命令查询 SKU 详细信息BillingClient,然后启动计费流程,就像官方教程中描述的那样。
在 Play 管理中心上,我们设置了所有必需的 SKU,并且它们都适用于我们的应用程序所在的所有区域。
导致响应代码的原因有哪些BILLING_RESPONSE_RESULT_BILLING_UNAVAILABLE?有没有可能所有用户都获得该代码但无法完成购买?
我发现很难调试这个问题,因为在我们这边一切都工作正常。
android in-app-billing android-billing android-inapp-purchase play-billing-library
我正在尝试调用 api Purchases.products: get来验证您的购买,它会产生这样的结果
{
"error": {
"errors": [
{
"domain": "androidpublisher",
"reason": "permissionDenied",
"message": "The current user has insufficient permissions to perform the requested operation."
}
],
"code": 401,
"message": "The current user has insufficient permissions to perform the requested operation."
}
}
Run Code Online (Sandbox Code Playgroud)
这里的文档说明了你可以做什么
收到的令牌不仅仅适用于任何其他 api 的购买检查,它返回结果(Inappproducts: list is work)
验证 url 构建正确,因为如果您将令牌客户端连接到服务器,那么此 api 也可以工作 - 但我需要一个服务器来进行服务器身份验证
scopes = ['https://www.googleapis.com/auth/androidpublisher']
authorization = Google::Auth.get_application_default(scopes)
uri = "https://www.googleapis.com/androidpublisher/v3/applications/#{ENV['ANDROID_PACKAGE_NAME']}/purchases/products/#{purchasable.purchase_uuid}/tokens/#{purchase_token}?access_token=#{authorization.fetch_access_token!['access_token']}" …Run Code Online (Sandbox Code Playgroud) authentication server-to-server google-oauth android-inapp-purchase
我想从我的 Android 应用程序打开谷歌订阅屏幕。有什么办法可以打开这个吗?
我知道可以从我们的应用程序打开应用程序列表(Play 商店),但不知道订阅屏幕。
谢谢。
我用 flutter 创建了 Stripe 支付网关,它现在正在测试模式下工作,我想在 StripeOptions() 中更改为实时模式(我已经更新了publishableKey和秘密)我必须更改androidPayMode和merchantId?,如果应该更改那么怎么办?我找不到任何与此相关的内容。
static init() {
StripePayment.setOptions(StripeOptions(
publishableKey:
"my key",
merchantId: "Test",
androidPayMode: 'test'));
Run Code Online (Sandbox Code Playgroud)
}
payment-gateway stripe-payments flutter wallet android-inapp-purchase
我有一个应用程序内购买功能,我认为遵循标准流程,但遇到了与按钮 setText() 更新相关的奇怪问题的挑战。\n这是我想要做的:
\nonBillingSetupFinished()我加载 SKus 并希望在按钮中显示价格。\n这并不总是有效,而且调试起来很痛苦,因为 Toast.makeText() 方法不显示任何进度。但最终我可以在模拟器中登录 Google Play 后在模拟器中重现该问题。setText(price)我注意到,如果我在下一行代码中执行按钮,则onBillingSetupFinished()不会执行。我在 logcat 中也没有看到任何内容。它在 后被卡住BillingClientStateListener-Setting Hard code price,永远不会到达BillingClientStateListener-DONE Setting Hard code price\n奇怪的是偶尔它会起作用,但大多数时候它不会。有什么指示可以指导我下一步应该做什么吗?
这是我的代码摘录:
\n布局摘录自:
\n <LinearLayout\n android:layout_width="wrap_content"\n android:orientation="horizontal"\n android:layout_height="wrap_content"\n android:layout_marginTop="2dp"\n android:layout_gravity="center"\n android:gravity="center_horizontal">\n <Button\n android:id="@+id/btn_buy_100coins"\n style="@style/BuyButton250"\n android:layout_width="120dp"\n android:text="@string/buy"\n android:onClick="onClickBuy100"\n />\n <Button\n android:id="@+id/btn_buy_250coins"\n style="@style/BuyButton250"\n android:layout_width="120dp"\n android:text="@string/buy"\n android:layout_marginLeft="15dp"\n android:onClick="onClickBuy250"/>\n\n <Button\n android:id="@+id/btn_buy_700coins"\n style="@style/BuyButton250"\n android:layout_width="120dp"\n android:text="@string/buy"\n android:layout_marginLeft="15dp"\n android:onClick="onClickBuy700"/>\n <TextView\n android:layout_width="50dp"\n android:layout_height="wrap_content"\n android:layout_gravity="center"\n android:text="@string/best_deal"\n android:textColor="@color/blue_neon"\n android:layout_marginLeft="5dp"\n android:textSize="14sp"\n android:textStyle="bold"\n />\n\n …Run Code Online (Sandbox Code Playgroud) 我有一个 Android 应用,用户可以在其中购买 1 个应用内产品来解锁某些功能。
我已广泛阅读指南:https : //developer.android.com/google/play/billing/billing_library_overview#java
我了解为了让用户购买 inapp 产品,我必须:
querySkuDetailsAsync()调用检索可用 SKU 的列表(在本例中,是我唯一的 1 个应用内产品)。这只是为了仔细检查用户的设备是否能够管理应用内产品。launchBillingFlow()传递我的应用内产品的 SKU,以启动 Google 付款流程(Google UI、要求卡详细信息的弹出窗口等。)onPurchasesUpdated()以获取返回代码(基本上是付款被拒绝、付款成功或付款取消)并采取相应措施。如果付款成功,请继续在本地(使用 Play 开发人员的 RSA 公钥的本地副本)或使用相同密钥在我的安全服务器上远程验证购买令牌签名。这就是事情变得混乱的地方。从 Google 文档的角度来看,工作已经完成,他们向您解释了如何检索/购买/和验证用户付款。但是,没有任何地方解释如何在应用程序启动期间记住付款和解锁付费功能。
该文件指出:
要检索有关用户从您的应用程序进行的购买的信息,请调用 queryPurchases()
因此,该应用程序似乎不需要记住任何内容,只需queryPurchases()在启动时调用并检查 SKU 是否存在(用户已为其付费)(用户仍未购买该应用程序的付费版本)。
所以我的应用程序就是这样做的,queryPurchases()在启动时调用并检查 SKU 是否存在。这种方法非常有效,即使应用程序离线启动也是如此。然而,一些用户感叹有时应用程序没有以付费模式启动,因为(我调试了代码)该功能queryPurchases()在设备离线时(有时)失败。会不会queryPurchases()是调用本地 Google Play 缓存,因为某些原因可能会丢失以前购买的记录?(缓存清除等...)
在应用程序启动时记住用户购买和启用付费功能的合适方法是什么?
android in-app-purchase google-play sku android-inapp-purchase
android ×4
google-play ×2
flutter ×1
google-api ×1
google-oauth ×1
settext ×1
sku ×1
subscription ×1
wallet ×1