在flutter_stripe中设置klarna付款时出错

iezvtpos  于 2023-06-07  发布在  Flutter
关注(0)|答案(1)|浏览(387)

我正在使用flutter_stripe库在我的应用程序中设置支付,但看到一个错误,似乎没有在他们的文档中涵盖。
这是我的代码:

final paymentIntent = await Stripe.instance.confirmPayment(
            paymentIntentClientSecret: store.state.basket.intentSecret!,
            data: PaymentMethodParams.klarna(
              paymentMethodData: PaymentMethodData(
                  billingDetails: billingDetails,
                  shippingDetails: shippingDetails),
            ),
            options: const PaymentMethodOptions(),
          );

按照此页上的示例:
https://github.com/flutter-stripe/flutter_stripe/blob/main/example/lib/screens/regional_payment_methods/klarna_screen.dart
我得到以下错误:

StripeException(error: LocalizedErrorMessage(code: FailureCode.Failed, localizedMessage: There was an unexpected error -- try again in a few seconds, message: You must provide a `return_url` when confirming a PaymentIntent with the payment method type klarna., stripeErrorCode: , declineCode: null, type: invalid_request_error))

据我所知,没有办法向confirmPayment方法提供return_url参数,任何帮助都将不胜感激。

6yoyoihd

6yoyoihd1#

原来有一个Stripe.urlScheme = 'stripe-app';需要在条带库中全局设置为pay later方法。

相关问题