我已经实现了Braintree SDK,它支持支付使用贝宝,信用卡或借记卡和谷歌支付。
除了谷歌支付之外,所有公司都在工作。当选择付款方法作为GooglePay时,我会收到以下错误。
这个商人是不启用谷歌支付,即使我已经启用谷歌支付选项在Braintree控制台。
以下是实施守则:
付费代码按钮单击:
DropInRequest dropInRequest = new DropInRequest()
.amount(strAmount)
.googlePaymentRequest(getGooglePaymentRequest())
.tokenizationKey("production_key_xxxxxxxxx");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
startActivityForResult(dropInRequest.getIntent(getActivity()), 399);
}
private GooglePaymentRequest getGooglePaymentRequest() {
return new GooglePaymentRequest()
.transactionInfo(TransactionInfo.newBuilder()
.setTotalPrice(strAmount)
.setCurrencyCode("USD")
.setTotalPriceStatus(WalletConstants.TOTAL_PRICE_STATUS_FINAL)
.build())
.emailRequired(true);
}我会感谢你的帮助。
发布于 2018-08-07 10:53:09
发布于 2019-05-03 05:33:04
您还需要添加googleMerchantId(“您的-商人-ID”)
merchantId参数在PaymentDataRequest中必须设置为您的Google配置文件中提供的值。
https://developers.google.com/pay/api/web/support/troubleshooting#merchantId
https://stackoverflow.com/questions/51635500
复制相似问题