laz*_*exe 2 java payment android braintree
我们正在开发用于订购食品的应用程序。在这种情况下,我们实施了 Braintree 支付。一切都很好。下一步是实施 Google Pay(我注意了,不是 Android Pay)。我使用了这个文档:Braintree Docs:https : //developers.braintreepayments.com/guides/pay-with-google/configuration/android/v2
谷歌 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);
}
Run Code Online (Sandbox Code Playgroud)
并使用:
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);
Run Code Online (Sandbox Code Playgroud)
在这种情况下,我们有两种情况:在我同事的设备上一切正常(视频:https : //drive.google.com/open?id=1wEXbv8qzGXzuXWDUy7-bhIdud_4H_s2V)
在我这边,我崩溃了(视频:https : //drive.google.com/open?id=15gvtkNGZ9w6v1ym7cDkwWCnqHh5JUvL7)
正如你在 Braintree 的 BaseActivity 中看到的,我得到了 statusCode=10 的异常,这意味着 DEVELOPER_ERROR。
那么有没有人想过如何修复它?
我在实施 Google Pay 时遇到了同样的错误,我在这里找到了问题的答案:https : //developers.google.com/pay/api/android/support/troubleshooting
报价:
最常见的错误消息是 ERROR_CODE_DEVELOPER_ERROR。此错误消息还作为带有以下文本的对话框出现在 UI 中:
请求失败 发生意外错误。请稍后再试。
要了解有关此错误的更多信息,请执行以下步骤:
adb -d logcat -s WalletMerchantError
响应指示错误的根本原因。例如,您可能会看到:
02-26 17:41:28.133 14593 14593 W WalletMerchantError:loadPaymentData 错误:此商家资料无权使用此功能。
注意:只有在您按下 OK 关闭警报后,该错误才会在 logcat 中可见。
解决问题所需采取的措施取决于错误消息。
| 归档时间: |
|
| 查看次数: |
1847 次 |
| 最近记录: |