gpt4 book ai didi

swift - Code=50 “No such payment_intent” 确认 Stripe 付款意图时

转载 作者:行者123 更新时间:2023-12-01 22:21:07 26 4
gpt4 key购买 nike

使用此方法确认付款意图时出现以下错误STPAPIClient.shared().confirmPaymentIntent()

Error Domain=com.stripe.lib Code=50 "No such payment_intent: pi_1ElaQpFSNNCQ7y59" UserInfo={com.stripe.lib:ErrorMessageKey=No such payment_intent: pi_1ElaQpFSNNCQ7y59, com.stripe.lib:StripeErrorCodeKey=resource_missing, com.stripe.lib:StripeErrorTypeKey=invalid_request_error, com.stripe.lib:ErrorParameterKey=intent, NSLocalizedDescription=No such payment_intent: pi_1ElaQpFSNNCQ7y59}

我正在执行的代码:

STPAPIClient.shared().confirmPaymentIntent(with: paymentIntentParams, completion: { (paymentIntent, error) in

if let error = error {

// handle error

} else if let paymentIntent = paymentIntent {

// see below to handle the confirmed PaymentIntent

if paymentIntent.status == .requiresAction {

guard let redirectContext = STPRedirectContext(paymentIntent: paymentIntent, completion: { clientSecret, redirectError in

// Fetch the latest status of the Payment Intent if necessary
STPAPIClient.shared().retrievePaymentIntent(withClientSecret: clientSecret) { paymentIntent, error in

// Check paymentIntent.status
}

})else{

// This PaymentIntent action is not yet supported by the SDK.
return;
}
redirectContext.startRedirectFlow(from: self)

}else{
// Show success message
}
}
})

最佳答案

如果您使用stripe connect(直接收费)功能,您需要在前端创建 stripe 实例时传递 stripe 连接帐户 ID(stripeAccount)。请参阅下面的示例

var stripe = Stripe(STRIPE_PUBLIC_KEY, { stripeAccount: "{{ connected_account }}" });

关于swift - Code=50 “No such payment_intent” 确认 Stripe 付款意图时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56610256/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com