#vasant-dhatrak_code
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1266315600741797980
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- vasant-dhatrak_code, 21 hours ago, 7 messages
- vasant-dhatrak_code, 22 hours ago, 33 messages
- vasant-dhatrak_api, 6 days ago, 12 messages
Hi anyone to help me
Hi, what's the exact challenge you're facing?
TypeError: Cannot read properties of undefined (reading 'create')
hello
any solution
It seems like stripe.paymentIntents is undefined. How are you importing Stripe?
const stripe = Stripe('pk_test_51NoJUWLDi2gy2gxo9m1xbo09COZBxWk1RIkP5veWTc20z9JnTnkJPNtMfnKUAuaPCW6L5Eb8NoM9ZK5xkWBo8Zmy000OZv91qu');
can you please check
hi
what library are you using?
I think you're using the frontend library to do a server-side action
so you need to have a backend with a Stripe SDK
that is different than Stripe.js
so for node backend it's called stripe-node https://github.com/stripe/stripe-node as opposed to the front-end library https://github.com/stripe/stripe-js
hello
yes
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Checkout</title>
<script src="https://js.stripe.com/v3/"></script>
<script src="testing_express_checkout.js" defer></script>
</head>
<p>Testing Here</p>
<div id="express-checkout-element">
<!-- Express Checkout Element will be inserted here -->
</div>
<div id="error-message">
<!-- Display an error message to your customers here -->
</div>
</html>
i also add this code
so i think dont need to install stripe in js
yes that's correct on the front-end side
but you need a backend code to create the PaymentIntent
yes but i dont know
in that case you can use https://docs.stripe.com/no-code/buy-button
i want for express checkout
express checkout element needs a backend integration not just a frontend
any context on when/where that error happens?
you're running this code in the frontend, in the browser, but you copy/pasted code for our backend (Node.js) library, so that won't work.
so how can i make runanble code
by following a guide such as https://docs.stripe.com/elements/express-checkout-element/accept-a-payment
can i make payment intent create code in plain javascript file
what would be executing that plain javascript file, in your design?
creating payment intent
no, I mean, you have a "plain javascript file". That's just a text file. What software are you imagining is going to read and execute the code in that file?
php
how can a PHP server execute Javascript?
sure. So what you mean is that your PHP server can serve a Javsacript file to the client( the customer's webbrowser) , and it's the customer's web browser that is executing the Javascript.
that code can not create a PaymentIntent no, since that would require the code to have your secret API key, and you can not give that to the customer.