#arpu_payment-element-eventdata

1 messages ยท Page 1 of 1 (latest)

spring yarrowBOT
#

๐Ÿ‘‹ 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/1293992255694307360

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

proud agate
still mountain
#

hi @proud agate yes and on ready? but there are no values return in the event

#

hmm looks like the event is not complete

proud agate
#

Hmmm.. I see what you mean. I can only see the the Payment Method type

still mountain
#

this is the event from ready

proud agate
#

The ready event is only emitted when the element is fully rendered. SO at that point we have no information from the user

still mountain
#

would be nice to get the selected defaultCountry in this state

proud agate
#

But even for the change event, there isn't much data provided

still mountain
#

yes, wonder how to get the infos

proud agate
#

would be nice to get the selected defaultCountry in this state
That does not make any sense to me. The ready event fires before your customer has done anything

#

But I do think the change event should include that detail

still mountain
#

stripe automatic sets the country in the first load

#

and if the user do not change the country we do not get the value

#

ok if change give me all data if the user adds the card than all should work with change event

proud agate
#

I see what you mean. Unfortunately we do not expose that data unless the customer selects a saved payment method

still mountain
#

at this state this is the first time the user subscribe

proud agate
#

Right, so unfortunately we do not currently have any events that provide these details

#

It is a known issue that has been raised and is being reviewed internally

#

I will be happy to add your request for this feature

still mountain
#

the problem is i need to set the country in the customer_address field, because without the country all other fields are now shown in the generated invoice pdf

proud agate
#

Okay, wait. Now I'm confused a bit.

Where are you trying to specify the country?

still mountain
#

workflow is like this:
generate the payment intent on server ( no infos from user)
load the PaymentElement with the secret in the frontend , if user submit update the customer with address info like country address name line1 line2 on the server with stripe api
use .confirmPayment
confirm with webhook on server

#

the first problem is if the costumer address country is not set no address is shown in the invoice
second problem to get the country ( default selected or user changed it ) value from the PaymentElement

proud agate
#

Okay so you want to update customer's country before you confirm the payment intent?

still mountain
#

yes

proud agate
#

Okay there is a way you can do this but it would require reworking your front-end code.

still mountain
#

becasue i need this info on the invoice

proud agate
#

And I will still file your feedback about the Payment Element

still mountain
#

ohh Thanks to point me to this

#

looks like this would be the best solution

#

best practice ๐Ÿ™‚

proud agate
#

Great ๐ŸŽ‰ I"m glad I could offer a solution that fits your use case

#

I've also filed your feedback requesting country data be emitted from the Payment Element