#infiniluxe
1 messages · Page 1 of 1 (latest)
👋 happy to help
would you mind sharing the request ID? https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
I do not have logs error
would you have a bit more context then like the exact code you're using, the guide you're following, details of what result/value you're expecting to see and what you see instead?
function createToken() {
const stripe = Stripe(
"pk_test_"
);
const myForm = document.querySelector(".my-form");
myForm.addEventListener("submit", handleForm);
function handleForm(event) {
event.preventDefault();
stripe.createToken("account", {
business_type: "company",
tos_shown_and_accepted: true,
}).then((result) => {
if (result.token) {
const tokenAccountInput = document.querySelector("#token-account");
tokenAccountInput.removeAttribute("disabled");
tokenAccountInput.value = result.token.id;
} else {
alert("Error token.");
}
});
}
}
function SendToXano() {
const xano_input = {
email: document.getElementById("email").value,
password: document.getElementById("password").value,
token: document.getElementById("token-account").value,
};
fetch("[YOUR XANO SIGNUP ENDPOINT URL HERE]", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(xano_input),
})
.then((res) => res.json())
.then((json) => {
const xanoResponse = json;
console.log(xanoResponse);
const hasKey = Object.keys(xanoResponse).includes("authToken");
console.log(hasKey);
if (hasKey === false) {
alert("L'utilisateur existe déjà .");
} else {
alert("Nous avons un authToken !");
const authToken = xanoResponse.authToken;
localStorage.setItem("authToken", authToken);
location.href = "[WHERE TO REDIRECT THE USER AFTER SIGNUP]";
}
});
}
I removed the link and api
thanks. And where excatly in this code does the issue arise?
In my console I get a "thanks. And where excatly in this code does the issue arise?"
An invalid form control with name='token-account' is not focusable.
Could you please share a screenshot?
sounds like you don't have an element with the ID token-account in your HTML. Or if you do generally, you don't have it at the time that you're running that code(for example if it doesn't exist in the DOM at the time you call createToken).
It's hard for us to help, we don't have as much access to your code and HTML set up as you do. Does the above make sense?
i'm on webflow for the front end and slater for the front end code and xano for the back end. i'd have to wait for the response from token stripe to continue my javascript code. if i understand correctly
?
I don't know what slater or xano are, sorry.
But depending on what you're trying to do, sometimes you need to create an AccountToken on the frontend and then submit it to your backend yes, such as if you're using Stripe Connect with a French platform and this is the flow where you let the end-user sign up for a Stripe account on your platform.
yes I'm doing a french platform with stripeConnect and it asks me for the token. yes my request is frontend for the token.
sounds good! I can try to help but I don't really understand what exact problem you've run into and where in your code you're stuck.
I'd add some logs/debugging and try to figure out something like which exact line of code does something you don't expect or is throwing an error.
I can give you the link of the web page ' https://sejour-serein-d1a7d3.webflow.io/signup '.
well it's because you have a hidden field for the token, but you mark it as required
if you Google the error message a bit you can see people recommend things like removing the required paramter from that <input> tag : https://stackoverflow.com/a/23215333/9769731
I don't have a token-account
You just got a form submission!
Form
my-form
Site
sejour serein
Submitted content
Email One 2: seillier.alexandre@orange.fr
token-account:
Password One 2: (removed)
Number of submissions received
1/50 this month
January 1st – January 31st
what code generates the text that this email(?) contains?
also, on that link https://sejour-serein-d1a7d3.webflow.io/signup , the code you mentioned about createToken and SendToXano , none of that code actually exists on that page from what I can see.
so obviously without that there would be no token created.
is there another developer at your company that you could pair with on building this?
I don't know it's in the webflow platform
le code stripe est dans slater
the code is functional in slater
I don't know what that means sorry.
slater is a code platform for webflow to dev. faster without all the page reloading each time.
ok.
I'm going to test the javascript directly on the page
so going back to what I mentioned earlier : I'd suggest that you add some logs/debugging and try to figure out something like which exact line of code does something you don't expect or is throwing an error.
yes, I'll do that for sure.