问题描述
我一直在使用条带支付,现在我想集成 3d 安全,但文档对我没有帮助,有没有人在 ios 上使用 3d 安全?
我的主要问题是如何或何时初始化提供 STPThreeDSUI 来处理身份验证的 STPPaymentHandler。
请帮忙。
这个链接没有有用的信息
https://stripe.com/docs/payments/3d-secure#ios-testing
https://github.com/stripe/stripe-ios
解决方法
您可以在此处查看如何使用 STPPaymentHandler 的示例:https://github.com/stripe-samples/accept-a-card-payment/blob/master/using-webhooks/client/ios/App%20(Swift)/CheckoutViewController.swift#L112
本质上,在客户提交他们的付款详细信息后,您希望获得 STPPaymentHandler 的全局共享实例(使用 STPPaymentHandler.shared()
)。然后您可以调用 confirmPayment
方法来处理任何需要的身份验证。
我建议看看 Stripe 的 guide for accepting a payment ,它涉及到这一点。如果您使用的是预构建的 UI,请改用此 guide