在android中实现strip时没有这样的payment_intent异常

问题描述

enter image description here


PaymentResultCallback 错误请求 ID:req_MGyLTQyOn3I8g6 com.stripe.android.exception.InvalidRequestException:没有这样的 payment_intent:'pi_1IX00QCDJIQbpq2SeG5K0R84'

解决方法

在初始化 Stripe 变量时更改可发布密钥(此密钥仅用于在您的应用程序上线时使用实时密钥进行测试)

就我而言

stripe = new Stripe(getApplicationContext(),Objects.requireNonNull("pk_test_9OsFgGsbGyohk6dzw7bbFlLP00100jL2UE"));

https://stripe.com/docs/keys

,

确保您在正确的环境中使用了正确的可发布密钥和密钥集。