#Nate - Elements email
1 messages · Page 1 of 1 (latest)
so i'm using the us_bank_account=betav2 functionality and am running into an issue where i need to call a stripe method directly and pull whatever the user types in from the Name and Email fields. The last time I mentioned I'm working with a beta my thread got archived but this is a bit time sensitive so I'm hoping we can work around that
Basically I am using a react PaymentElement and one of my payment types is [us_bank_pay] where the user fills out an email and a name which invokes that process, however since they are entering it within a stripe element, I seem to have no way of accessing what they are typing ? If I can access that my issues would be solved
Nate - Elements email
Gotcha. Checking in to if there is a way to pull that field from the client side.
What do you need the email for? Still looking in to your initial question, I just want to keep that in mind in case we need a workaround.
Thanks for looking into it this is super appreciated, I have been unable to find help and at this point any kind of workaround would be awesome
I can add a few screenshots to make more sense, but I need to call this
and the billing details that are provided that I need to pass in are in this stripe form
So I am at the point where best case scenario I can pull those values from this PaymentElement react element and plug it into my above code
And this form is loaded into your site via Stripe React?
Yes, I am using react and am using a PaymentElement, here is my JSX for the stripe form
What have you already tried to access the value in the email field?
This is where I'm unsure how I would access it, because I cannot pull any DOM elements out of the iframe with a getElementById or something of that sort
I'm hoping there there is some way to possibly pull it from the react stripe library?
The React library is just a thin wrapper around the Stripe Elements javascript.
Ah ok so no values can be pulled out? So do you not see this as a valid solution? Is getting the value of a textbox within a stripe element just not going to be possible in your opinion? I can go another direction
Here is what invoked me doing this in the first place:
Maybe you can redirect me or help with it
I had our payments integrated with stripe using us_bank_account=betav1 however we needed to move to us_bank_account=betav2 to use some functionality that is not in v1. In v1 when the confirmPayment method is called, the paymentelement automatically knew to pull up the forms for the user to enter their name and email which is a required parameter in the method collectUsBankAccountForPayment. In v2 now we are just thrown an error, so combat this I catch the error, and then call the method, but I cannot access the fields in the stripe form when I do have to call it myself.
In that case I would think it would make more sense to instantiate the Stripe Element without those fields, then create them yourself as part of your interface so you can access the values within them.
Ahh yes this is what I feared lol
So are you suggesting that I use stripe forms for all forms of payment, and then if they want to use bank pay I just make my own UI? And this would means that I do not include [us_bank_account] for the payment_method_types on this paymentIntent then correct? So that it would not show on the stripe form