Following are the error while working:
Not working with sr in script tag like following:
<script src="https://js.stripe.com/v3/" async></script>After adding it manually now mounting card but not know how to create checkout after form submission with card values.
Following function not working:
fetch('/create-checkout-session', { method: 'POST', }) .then(function (response) { console.log('response', response); // return response.json(); }) .then(function (session) { console.log('session', session); // return stripe.redirectToCheckout({ sessionId: session.id }); }) .then(function (result) { console.log('result', 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); // } });
error:
POST chrome-extension://nldmbdiekelgaahflcjkhigmiochfaib/create-checkout-session net::ERR_FILE_NOT_FOUND