我正在使用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
参数,任何帮助都将不胜感激。
1条答案
按热度按时间6yoyoihd1#
原来有一个
Stripe.urlScheme = 'stripe-app';
需要在条带库中全局设置为pay later方法。