Gdy naciskam przycisk na interfejsie mnie kierują na host lokalny/utwórz konto zamieszczone na hostingu, ale pojawia się "Nie można OPUBLIKOWAĆ". Listonosz, pokazuje jednak, że punkt końcowy działa dobrze.
Nie jestem pewien, co ja tu się pomylił.
Wewnętrzny punkt końcowy w folderze funkcji Firebase
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)
Forma kodu pierwszego planu WYSYŁA żądanie przekierowania po stronie serwera.
<div className="beASeller">
<form
type="submit"
action="/create-account-hosted"
method="POST"
class="stripe-connect white"
>
<button> Seller Signup</button>
</form>
</div>