【发布时间】:2023-01-30 09:45:55
【问题描述】:
我正在尝试按照此文档设置 Stripe Connect:https://stripe.com/docs/connect/enable-payment-acceptance-guide?platform=web&ui=checkout#create-account-link
在帐户链接阶段,它将我重定向到 Stripe 以创建帐户等 - 出于开发目的,我想跳过这个而不是每次都输入真实数据。
我偶然发现了这个用于测试 Stripe 的文档:https://stripe.com/docs/connect/testing 它说有一种方法可以强制跳过,但我没有看到任何弹出窗口。我需要传递一个特殊值来启用强制跳过选项吗?
这是我用来测试帐户链接的代码 sn-ps
const stripe = new Stripe(secrets.STRIPE_SECRET_KEY, {
apiVersion: "2022-11-15"
});
export class StripeClient {
/**
* Create a Stripe account for a user. The account will be associated with the ZCal account
*/
static accountCreationRequest = async (): Promise<Stripe.Response<Stripe.Account>> => {
const account: Stripe.Response<Stripe.Account> = await stripe.accounts.create({
type: "standard"
});
return account;
};
static accountLinkRequest = async (stripeAccountId: string): Promise<Stripe.Response<Stripe.AccountLink>> => {
const accountLink: Stripe.Response<Stripe.AccountLink> = await stripe.accountLinks.create({
account: stripeAccountId,
refresh_url: `${config.CLIENT_BASE_URL}/account/integrations`,
return_url: `${config.CLIENT_BASE_URL}/account/integrations`,
type: "account_onboarding"
});
return accountLink;
};
}
【问题讨论】:
标签: stripe-payments