Hi, let me tell you about the problem I have.
I am developing a web page in react.js and node.js and I am using square to accept payments.
My page is completely responsive, that is, from any IOS or Android phone it works well.
Now the problem this is when the squarePayment form is going to be loaded on the phone, which is the card number, card expiration date, security code and zip code, it gives me an error and does not load anything.
If I do everything from a computer, everything works fine, but from the phone I get that error that I tell you.
My question is for you to function my website from the phone, I must do something else. Here I leave the code where it gives me the error on the phone.
useEffect(() => {
if(auth.token !== '') {
let sqPaymentScript = document.createElement("script");
// sandbox: https://js.squareupsandbox.com/v2/paymentform
// production: https://js.squareup.com/v2/paymentform
sqPaymentScript.src = "https://js.squareupsandbox.com/v2/paymentform";
sqPaymentScript.type = "text/javascript";
sqPaymentScript.async = false;
sqPaymentScript.onload = () => {
setLoad(true);
};
document.getElementsByTagName("head")[0].appendChild(sqPaymentScript);
} else {
props.history.push('/iniciar-sesion');
console.log('token false')
}
});
this is exactly where I get the error
sqPaymentScript.onload = () => {
setLoad(true);
};
I hope you can help me
thank you very much