gpt4 book ai didi

java - Braintree + Google Pay 出现 DEVELOPER_ERROR (statusCode=10)

转载 作者:搜寻专家 更新时间:2023-11-01 07:44:05 35 4
gpt4 key购买 nike

我们正在开发用于订餐的应用程序。在这种情况下,我们实现了 Braintree 支付。一切都很好。下一步是实现 Google Pay(请注意,不是 Android Pay)。我使用了这个文档:布伦特里文件: https://developers.braintreepayments.com/guides/pay-with-google/configuration/android/v2

Google PwG 文档: https://developers.google.com/payments/setup

我们如何实现 Google Pay:

private GooglePaymentRequest getGooglePaymentRequest(String total) {
return new GooglePaymentRequest()
.transactionInfo(TransactionInfo.newBuilder()
.setTotalPrice(total)
.setTotalPriceStatus(WalletConstants.TOTAL_PRICE_STATUS_FINAL)
.setCurrencyCode("AUD")
.build())
.emailRequired(false)
.shippingAddressRequired(false)
.phoneNumberRequired(false)
.allowPrepaidCards(true)
.billingAddressRequired(false);
}

并使用:

String total = String.format(Locale.getDefault(), "%1$.2f", basket.total);

DropInRequest dropInRequest = new DropInRequest()
.clientToken(clientToken)
.amount(total)
.googlePaymentRequest(getGooglePaymentRequest(total))
.collectDeviceData(true);

getMvpView().showBraintreePaymentScreen(dropInRequest);

在这种情况下,我们有两种情况:在我同事的设备上一切正常(视频:https://drive.google.com/open?id=1wEXbv8qzGXzuXWDUy7-bhIdud_4H_s2V)

我这边撞车了(视频:https://drive.google.com/open?id=15gvtkNGZ9w6v1ym7cDkwWCnqHh5JUvL7)

之后我开始调试并观察下一个情况: enter image description here

正如您在 Braintree 的 BaseActivity 中看到的那样,我得到了 statusCode=10 的异常,这意味着 DEVELOPER_ERROR。

那么有人知道如何修复它吗?

最佳答案

我在实现 Google Pay 时遇到了同样的错误,我在这里找到了问题的答案: https://developers.google.com/pay/api/android/support/troubleshooting

引用:

最常见的错误消息是 ERROR_CODE_DEVELOPER_ERROR。此错误消息还作为带有以下文本的对话框出现在 UI 中:

Request Failed An unexpected error has occurred. Please try again later.

要了解有关此错误的更多信息,请按照以下步骤操作:

  1. 确保您的计算机上安装了 ADB。
  2. 确保您的设备上启用了 USB 调试。
  3. 使用 USB 数据线将手机连接到计算机。
  4. 在您计算机上的终端或命令提示符中运行以下命令:

adb -d logcat -s WalletMerchantError

响应指示错误的根本原因。例如,您可能会看到:

02-26 17:41:28.133 14593 14593 W WalletMerchantError: Error in loadPaymentData: This merchant profile does not have access to this feature.

注意:只有在您按下“确定”关闭警报后,该错误才会在 logcat 中可见。

解决问题所需采取的操作取决于错误消息。

关于java - Braintree + Google Pay 出现 DEVELOPER_ERROR (statusCode=10),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48410895/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com