使用nodejs和stripe实现苹果支付令牌

问题描述 投票:0回答:1

我想在我的项目中实现条带支付网关,我将从客户端获取 Apple Pay 令牌。但我怎样才能传递它,因为当我尝试传递它时,条带会出现错误 StripeInvalidRequestError: Invalid string: eyJkYXRhIj...FfdjEifQ==;最多 5000 个字符

const paymentIntent = await stripe.paymentIntents.create({
            amount: 1*100,
            currency: 'usd',
            payment_method_types: ['card'],
            payment_method_data: {
                type: 'card',
                card: {
                    token:  req.body.AppleToken // Payment token received from iOS app
                }
            }
        });

        // Process the payment request with Stripe
        const paymentResult = await stripe.paymentIntents.confirm(paymentIntent.id);
        // If payment is successful
        if (paymentResult.status === 'succeeded') {
            res.status(200).json({ success: true, message: 'Payment successful' });
        } else {
            res.status(500).json({ success: false, error: 'Payment failed' });
        }

我收到错误 StripeInvalidRequestError:无效字符串:eyJkYXRhIj...FfdjEifQ==;最多不得超过 5000 个字符 有谁知道如何将苹果令牌传递到条纹中吗?

node.js stripe-payments applepay
1个回答
0
投票

不鼓励在 Stripe 中使用原始 Apple Pay 令牌。您可以使用快速结帐元素付款元素移动支付元素,它们都支持开箱即用的 Apple Pay。

如果您出于某种原因确实需要使用原始 Apple Pay 令牌,您可以尝试与 Stripe 支持联系。

© www.soinside.com 2019 - 2024. All rights reserved.