【发布时间】:2018-07-02 19:32:52
【问题描述】:
我们正在开发用于订餐的应用程序。在这种情况下,我们实施了 Braintree 支付。一切都很好。下一步是实施 Google Pay(请注意,不是 Android Pay)。 我使用了这个文档: Braintree 文档: 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)
正如您在 Braintree 的 BaseActivity 中看到的,我遇到了 statusCode=10 的异常,这意味着 DEVELOPER_ERROR。
那么有没有人想过如何修复它?
【问题讨论】:
-
已编辑。删除了屏幕截图,添加了源代码部分。
-
只是为了确认一下,您是否在每台设备上运行相同版本的代码?您的设备和位置与您同事的有什么区别?
-
是的,我们在每台设备上运行相同的代码。设备:Nexus 5X(我的)和 Nexus 6p(他的)。地点:同一个国家(我们之间距离 300 公里)
标签: java android payment braintree