#vasant-dhatrak_code

1 messages ¡ Page 1 of 1 (latest)

remote forgeBOT
#

👋 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.

inland vortexBOT
#

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.

thorny nacelle
#

Hi anyone to help me

mild pine
#

Hi, what's the exact challenge you're facing?

thorny nacelle
#

TypeError: Cannot read properties of undefined (reading 'create')

#

hello

#

any solution

remote forgeBOT
mild pine
#

It seems like stripe.paymentIntents is undefined. How are you importing Stripe?

thorny nacelle
#

const stripe = Stripe('pk_test_51NoJUWLDi2gy2gxo9m1xbo09COZBxWk1RIkP5veWTc20z9JnTnkJPNtMfnKUAuaPCW6L5Eb8NoM9ZK5xkWBo8Zmy000OZv91qu');

#

can you please check

#

hi

kind mulch
#

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

GitHub

Node.js library for the Stripe API. . Contribute to stripe/stripe-node development by creating an account on GitHub.

GitHub

Loading wrapper for Stripe.js. Contribute to stripe/stripe-js development by creating an account on GitHub.

thorny nacelle
#

hello

kind mulch
#

yes

thorny nacelle
#

<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

kind mulch
#

yes that's correct on the front-end side

#

but you need a backend code to create the PaymentIntent

thorny nacelle
#

yes but i dont know

kind mulch
thorny nacelle
#

i want for express checkout

kind mulch
#

express checkout element needs a backend integration not just a frontend

remote forgeBOT
thorny nacelle
#

hello

#

TypeError: Cannot read properties of undefined (reading 'create')

vapid monolith
#

any context on when/where that error happens?

thorny nacelle
vapid monolith
#

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.

thorny nacelle
#

so how can i make runanble code

vapid monolith
thorny nacelle
vapid monolith
#

what would be executing that plain javascript file, in your design?

thorny nacelle
#

creating payment intent

vapid monolith
#

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?

thorny nacelle
#

php

vapid monolith
#

how can a PHP server execute Javascript?

thorny nacelle
#

i open html front page

#

icludes link of javascript file

vapid monolith
#

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.