때 나는 버튼을 클릭 프론트 엔드에,나는 감독이 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>