我有应用程序,用户将支付一些钱,也用户将支付平台费.我在STRIPE有账户,平台费会打到STRIPE账户。全价将转到IBAN帐户。我收到错误:
StripeInvalidRequestError:无此目的地:1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
你能告诉我为什么我得到这个错误吗?是否有错误的IBAN格式,或者我应该使用不同的付款方式?谢谢你的帮助
const handler = async (req, res) => {
const Price = req.body.Price * 100
const id = req.body.id
const fees = (Price * 15) / 100
const item = await Product.findById(id) // I am getting product, all good
console.log('item iban', item.iban) // SK1111111111111111111111
const session = await stripe.checkout.sessions.create({
payment_method_types: ['card'],
line_items: [
{
name: item.name,
amount: Price,
currency: 'EUR',
quantity: 1,
},
],
payment_intent_data: {
application_fee_amount: fees,
transfer_data: {
destination: item.iban || null
}
},
success_url: process.env.STRIPE_SUCCESS_URL,
cancel_url: process.env.STRIPE_CANCEL_URL,
});
console.log(session)
}
export default handler
字符串
1条答案
按热度按时间jvlzgdj91#
您遇到的错误,
"StripeInvalidRequestError:无此目的地:'SK11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
提示您在transfer_data对象中提供的目标IBAN可能存在问题。
transfer_data对象中的destination字段需要一个有效的银行帐户ID或令牌,用于将平台费用转移到的连接帐户。但是,在您的代码中,您似乎直接将连接帐户的IBAN作为目标传递。这可能是错误的原因。
要解决此问题,您需要为连接的帐户(平台费用将转移到的Stripe帐户)创建令牌或银行帐户ID。您不能直接使用IBAN。
以下是如何为已连接的帐户创建银行帐户令牌:
字符串
型