nodejs中stripe中添加3D安全验证

Add 3D secure verification in stripe in nodejs

我接受通过 Stripe 付款。我在后端处理了所有与支付相关的查询。我只需要一个基本的条带令牌和身份验证密钥(我的 API 的)来访问这个 API.

收款代码

//if subscription added with user then accept the payment
stripe.customers.create({
    email: token.email,
    source: token.id
})
    .then(customer => {
        const idempotencyKey = uuid();
        stripe.charges.create(
            {
                amount: product.price * 100,
                currency: "usd",
                customer: customer.id,
                receipt_email: token.email,
                description: `Purchased the ${product.name}`,
                shipping: {
                    name: token.card.name,
                    address: {
                        line1: token.card.address_line1,
                        line2: token.card.address_line2,
                        city: token.card.address_city,
                        country: token.card.address_country,
                        postal_code: token.card.address_zip
                    }
                }
            },
            {
                idempotencyKey
            }
        );
    })

我在 google 上搜索了有关 3D 安全的信息,但所有解决方案似乎都与 payment_intent 挂钩。如何在 stripe.charge 方法中添加 3D 安全真实性。

How can I add the 3D secure authenticity in stripe.charge method.

你不能。

这是旧版 API,不支持 3D Secure。您必须迁移到使用 SCA 就绪集成,如 PaymentIntents(如您所述)或 Checkout。

https://stripe.com/docs/payments

https://stripe.com/docs/payments/older-apis#comparing-the-apis

https://stripe.com/docs/strong-customer-authentication#preparing