flutter - 我需要在条带支付方式中为 paymentIntentClientSecret 传递哪些参数?
问题描述
我正在创建条纹支付方式,但我不知道 paymentIntentClientSecret 需要什么,所以请帮我看看我的代码
await Stripe.instance.initPaymentSheet(
paymentSheetParameters: SetupPaymentSheetParameters(
applePay: true,
googlePay: true,
style: ThemeMode.dark,
testEnv: true,
merchantCountryCode: 'US',
merchantDisplayName: 'Flutter Stripe Store Demo',
customerId: "4242424242424242",
paymentIntentClientSecret:"",
customerEphemeralKeySecret:"sk_test_51JfOcKL28pDgfM8ZNcOgXcOau98OqZMoauV9Qq4fG06rsrHjL2olm4oIkd4DQCCuOh3079xJIo0t1KGNiv5c382L00ZNJHlCaU",
));
解决方案
根据doc, paymentIntentClientSecret 似乎需要一个字符串。
paymentIntentClientSecret property Null safety
String? paymentIntentClientSecret
inherited
Secret used for client-side retrieval using a publishable key.
If this value is null make sure to add a setupIntentClientSecret
再次基于文档,它来自运行
final paymentIntentClientSecret =
await _createPaymentIntent(Stripe.getReturnUrl());
/// Create payment intent and return the client secret.
/// The `return_url` must be set on the PaymentIntent.
/// https://stripe.com/docs/payments/payment-intents/android#create-payment-intent
Future<String> _createPaymentIntent(String returnUrl) {
return Future.value("client_secret");
}
推荐阅读
- here-maps-rest - 如何在反应中使用 HEREMAPS 禁用地图中的 3D 建筑视图?
- javascript - 使用 moment.js 从两个变量中设置日期和时间
- asp.net - 通过 365 从 asp.net 发送一封电子邮件,其中的“发件人”电子邮件与用户名不同
- javascript - 通过标识符访问对象
- python - 如何在python中对排列的每一行求和
- flutter - 颤振块 - 错误的状态从块发送到小部件
- scala - 如何将 current_timestamp() 列添加到流数据帧?
- docker - 在 gitlab-runner 容器中更改 config.toml 后参数 URL 未更新
- python - 纸浆 Lp:无法达到变量
- c# - 基本任务使用