当我按一下按钮在前端,我获得针对localhost/创建的帐户举办,但将呈现"无法职位"。 邮递员,但是显示了 终点。
不知道我有什么错在这里。
后台的终点上火力地堡的职能的文件夹
app.post("/create-account-hosted", async (req, res) => {
try {
var account = await stripe.accounts.create({
type: "custom",
requested_capabilities: ["card_payments", "transfers"],
business_type: 'company',
})
var accountLink = await stripe.accountLinks.create({
account: account.id,
success_url: "https://example.com",
failure_url: "https://example.com",
type: "custom_account_verification",
collect: "eventually_due",
});
} catch (err) {
console.log(err);
res.status(400);
res.send({ error: err });
return;
}
res.send(accountLink.url)
前端编码形式员额的请求服务器方向.
<div className="beASeller">
<form
type="submit"
action="/create-account-hosted"
method="POST"
class="stripe-connect white"
>
<button> Seller Signup</button>
</form>
</div>