【发布时间】:2021-06-28 04:13:42
【问题描述】:
我正在使用 Stripe Connect Express(新用户,关注 STRIPE API DOCS)。我目前正在尝试在成功创建 Stripe Express 帐户后创建 AccountLink。
但是,我无法创建 AccountLink,因为在创建 AccountLink 时出现错误,因为 account.refresh_url 和 account.return_url 似乎是 undefined
exports.onCreateAuthUser = functions.auth.user().onCreate(async (user) => {
// Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://dashboard.stripe.com/account/apikeys
const strip = require('stripe')('sk_test_key_input_here');
const account = await strip.accounts.create({
type: 'express',
});
let refURL = account.refresh_url
let retURL = account.return_url
console.log("account log stuff -->", account, retURL, refURL, account.uid, account.userId, account.userRef, account.user, account.id, account.ref, account.pushId, account.customer_id)
const accountLinks = await stripe.accountLinks.create({
account: account.id,
refresh_url: refURL,
return_url: retURL,
type: 'account_onboarding',
});
});
console.log 打印:
account log stuff --> undefined undefined undefined undefined undefined acct_1IbJSgPMwPhmaSsD undefined undefined undefined
有谁知道为什么这些属性是未定义的......以及我可以如何修复它或有什么问题?
【问题讨论】:
标签: api stripe-payments