estoy atrapado aquí por un tiempo ahora.
Tengo este simple botón en vainilla.
<td><button class="button_accept" onclick="acceptInvite(event, 0)" type="submit">accept</button></td>Dispara este script:
async function LoadPaymentController(){ var stripe = Stripe('testKey'); // Call your backend to create the Checkout Session fetch('/create-checkout-session', { method: 'POST', }) .then(function(response) { return response.json(); }) .then(function(session) { return stripe.redirectToCheckout({ sessionId: session.id }); }) .then(function(result) { // If `redirectToCheckout` fails due to a browser or network // error, you should display the localized error message to your // customer using `error.message`. if (result.error) { alert(result.error.message); } }); }Pero cada vez que hago clic aquí, Firefox me dice que:
Stripe.js requires 'allow-same-origin' if sandboxed.Hablé con un desarrollador del equipo de stripe y busqué en Google y siempre dice que tengo que agregar el atributo sandbox="allow-same-origin" a mi iframe.
Pero no estoy usando un iframe.
Agregar este atributo a todo lo demás tampoco funcionó en absoluto.
¿Qué me estoy perdiendo?
Lo intenté:
<meta http-equiv="Content-Security-Policy" content="allow-same-origin"> <script src="https://js.stripe.com/v3/"></script>En vano