Frontend'deki Düğmeyi tıkladığımda, localhost/create-account-hosted yönlendiriliyorum ancak "Gönderemiyorum" oluşturuyorum. Ancak Postacı, Son Noktanın gayet iyi çalıştığını gösteriyor.
Neyi yanlış anladığımdan emin değilim.
Firebase İşlevleri klasöründeki arka uç uç noktası
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)
Sunucu tarafı yeniden yönlendirmesi için ön uç kod formu POST isteği.
<div className="beASeller">
<form
type="submit"
action="/create-account-hosted"
method="POST"
class="stripe-connect white"
>
<button> Seller Signup</button>
</form>
</div>