#Farhaan_Kaleem-element
1 messages ยท Page 1 of 1 (latest)
๐ Give me a moment to read up and I'll respond as soon as I can ๐
The card number element is by default created without merchantID.
what exactly do you mean by "without merchant ID" here?
Is there a guide that you're following for this?
So when the element is created, _stripeAccount is null,
Later when I check the checkbox, I want the _stripeAccount to have merchantID
where exactly are you seeing this _stripeAccount property?
Are you using Stripe connect? Can you provide more details about your integration?
So when we create the stripe element, we wrap it up with a class, which has the loadStripe method in it. If we pass the stripeAccount field in it, we see the elements made with _stripeAccount. But when we dont pass it, _stripeAccount field in elements is empty or undefine
Gotcha, so that parameter is actually used with Stripe connect where it allows you to perform actions on behalf of that account.
https://stripe.com/docs/js/initializing#init_stripe_js-options-stripeAccount
True, So when I hit the checkbox, I want the cardnumber Element to be with merchant_ID, how can I do this?
AFAIK you'd need to reinitialize, let me check if we have some docs on this
correct you have to reload the whole page
Basically you should always know the account id before rendering Elements
so can u pls tell me how can I reload the page in this case?
Really the right solution is what I said: do not render the element until you know the connected account
But otherwise, you need to initialize Stripe again with the right account id, create a new element and mount it and destroy the old one
How can I mount it again?
Sorry I'm not sure how else to explain it. You write code that mount the element, just from a different Javascript instance
How to get elements from stripeObject?
I'm sorry I'm lost
like you must have already written all that code yourself to load and initialize Stripe, initialize Element, create the element, mount it, etc.
I mean I get the stripeObject after loadStripe(), right? So using this stripeObject, can I get the elements?