flutter - 当我在使用颤振条纹库时调用 mthod initPaymentSheet 时,颤振应用程序崩溃了
问题描述
错误显示此 No direct method (Ljava/lang/String;Lcom/stripe/android/paymentsheet/PaymentSheet$CustomerConfiguration;Lcom/stripe/android/paymentsheet/PaymentSheet$GooglePayConfiguration;Landroid/content/res/ColorStateList;ILkotlin/jvm/ internal/DefaultConstructorMarker;)V 在类 Lcom/stripe/android/paymentsheet/PaymentSheet$Configuration; 或其超类('com.stripe.android.paymentsheet.PaymentSheet$Configuration' 的声明出现在 /data/app/com.example.likecard-1/base.apk:classes4.dex 中),而我的代码是
Future<void> checkout() async {
/// retrieve data from the backend
Map<String, dynamic> body = {
'amount': 450,
'currency': "usd",
'payment_method_types[]': 'card'
};
await Stripe.instance.initPaymentSheet(
paymentSheetParameters: SetupPaymentSheetParameters(
applePay: true,
googlePay: true,
style: ThemeMode.dark,
testEnv: true,
customFlow: true,
merchantCountryCode: 'US',
merchantDisplayName: 'Flutter Stripe Store Demo',
customerId: "4242424242424242",
paymentIntentClientSecret:body.toString(),
customerEphemeralKeySecret:"sk_test_51JfOcKL28pDgfM8ZNcOgXcOau98OqZMoauV9Qq4fG06rsrHjL2olm4oIkd4DQCCuOh3079xJIo0t1KGNiv5c382L00ZNJHlCaU",
));
await Stripe.instance.presentPaymentSheet();
}
解决方案
推荐阅读
- xml - XSL 查找具有相同名称的位置
- xml - 将 XML 标记插入另一个标记
- reactjs - 在反应:未捕获(承诺)类型错误:无法读取未定义的属性“数据”
- c++ - 了解模板的声明、定义和特化
- asp.net - ASP.NET Core MVC:创建与以前在另一个视图上创建的作者关联的帖子
- javascript - 如何在reactjs中单击按钮取消下载文件?
- sql-server - SQL:72025: 引用的程序集 .DLL 已损坏或无效
- c# - 实体框架数据库优先和列属性不起作用
- php - 安全的 AWS S3 文件 url 如何在 php 中显示
- ms-access - 删除后保存记录