【发布时间】:2022-01-11 16:36:15
【问题描述】:
我遇到了 google pay with stripe 的问题。问题是我完全 遵循文档并得到一个模糊的错误。我有这个 onGooglePayResult 并且我总是有 Result.Failed 并出现错误 - “java.lang.RuntimeException: Google Pay failed with error 10”和错误代码 2.随时问我可以回答你的所有问题。
主要错误是 java.lang.RuntimeException:Google Pay 失败,错误 10:。这是在 GooglePayPaymentMethodLauncher.Result.Failed 中出现的。我真的不明白为什么会这样,我已经检查了两次条纹文档,谷歌支付设置和所有内容,但找不到。 我的意思是如何找出真正的错误消息是什么,我试图找到与此相关的任何内容,但不幸的是根本没有类似的内容。
Logcat - error = java.lang.RuntimeException: Google Pay 失败,错误 10:+ 错误代码 = 2
private fun onGooglePayResult(
result: GooglePayPaymentMethodLauncher.Result
) {
when (result) {
is GooglePayPaymentMethodLauncher.Result.Completed -> {
// Payment details successfully captured.
// Send the paymentMethodId to your server to finalize payment.
val paymentMethodId = result.paymentMethod.id
presenter.payPlanWithGooglePay(deviceIdentifier, paymentMethodId)
}
GooglePayPaymentMethodLauncher.Result.Canceled -> {
// User cancelled the operation
Timber.d("Cancel")
}
is GooglePayPaymentMethodLauncher.Result.Failed -> {
// Operation failed; inspect `result.error` for the exception
Timber.d("error = ${result.error} + error code = ${result.errorCode}")
}
}
}
【问题讨论】:
标签: java kotlin stripe-payments google-pay