我想在我的项目中实现条带支付网关,我将从客户端获取 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 个字符 有谁知道如何将苹果令牌传递到条纹中吗?