#johnl_code

1 messages ¡ Page 1 of 1 (latest)

trail joltBOT
hearty kestrelBOT
#

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.

trail joltBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1259723328764252224

📝 Have more to share? Add details, code, screenshots, videos, etc. below.

eager cargo
olive quartz
#

Hi there, so you want to surface name and email in PaymentElement?

eager cargo
olive quartz
eager cargo
#

That's a good first step, but I don't want to ask for an address, just fname, lname, and email

#

This doesn't even ask for email

olive quartz
#

Address is mandtory for AddressElement. In this case, you might want to build your own form to surface these info.

eager cargo
#

Is there an email element

olive quartz
#

No, AddressElement doesn't collect email.

eager cargo
#

Does any element?

olive quartz
eager cargo
#

Like build a form completly from scratch?

#

Including credit card info?

olive quartz
#

No. You should still use PaymentElement to collect senstive card info. You can build you own UI to collect name and email, and put your own UI together with PaymentElement.

eager cargo
#

I had this

#

But the issue was that the data was sent to the server at page load rather than when the button was pressed

#

And my server was like this

#

so I was trying to do req.Fname

olive quartz
#

issue was that the data was sent to the server at page load rather than when the button was pressed -> I don't quite understand this part, can you elaborate or show me the relevant code?

eager cargo
#

Like... you know how the Cost is sent on page load?

#

And then the user pays

#

Basically I was handling the fname, lname, email stuff the same was as cost is sent to the server

olive quartz
eager cargo
#

I am honestly struggling to understand these docs because it doesn't have any code examples... one sec

#

Is it saying this?

olive quartz
#

Ah, you should put this info under the payment_method_data.billing_details hash.

eager cargo
#

This?

olive quartz
#

Yes you are right!

eager cargo
#

So I implement it like this?

olive quartz
#

There's no lname or fname, just name

eager cargo
#

I see, and I prob don't need to put cardElement?

olive quartz
#

If you are using paymentElement, you should call confirmPayment, not confirmCardPayment

olive quartz
#

The screenshot that you posted earlier is using confirmCardPayment

eager cargo
#

oooh, that was from the docs, not my code

#

This is my current code

#

For some reason, the payment form now doesn't show up

#

I prob need card: cardElement?

#

cardElement isn't defined anywhere tho

#

That didn't change anything

olive quartz
#

The error message already explained the problem. have you obtained a clientSecret from backend and initalize the stripe eleements with it?

eager cargo
#

Initalize^

#

handleSubmit^

#

I prob sound really dumb, I'm not a JS dev or anything, but isn't the code already doing that?

olive quartz
eager cargo
#

Okay, I will do that. Do you think you can keep this channel open for the 24 hours?

olive quartz
#

This thread will be clsoed after sometime. Feel free to use the buttons on #help to start a new thread.

eager cargo
#

okay