【发布时间】:2019-01-09 03:44:18
【问题描述】:
我已经实现了 Braintree SDK,它支持使用 Paypal、信用卡或借记卡和 Google Pay 进行支付。
除 Google Pay 外,所有功能均正常运行。 选择付款方式为 GooglePay 时出现以下错误。
此商家未启用 Google Pay 即使我在 Braintree 控制台上启用了 Google Pay 选项。
以下是实现代码:
支付按钮点击代码:
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);
}
我们将不胜感激。
【问题讨论】:
-
fstanis 的答案是正确的。不要忘记在 SANDBOX 模式下运行您的 Braintree 服务器端实现,否则他们无法测试它!这也是您收到上述消息的原因。对于测试,您需要 1)Braintree 网站:启用 GooglePay(沙盒)2)Braintree 服务器实现切换到 SANDBOX(不要忘记使用 SANDBOX 密钥)3)客户端实现:WalletConstants.ENVIRONMENT_TEST
-
您找到解决方案了吗?为什么它不起作用?
-
您在哪个环境中遇到问题?测试/沙盒还是生产?
标签: android paypal braintree google-pay