#Farhaan_Kaleem-element

1 messages ยท Page 1 of 1 (latest)

hard fog
#

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

verbal ermine
#

So when the element is created, _stripeAccount is null,

Later when I check the checkbox, I want the _stripeAccount to have merchantID

hard fog
#

where exactly are you seeing this _stripeAccount property?
Are you using Stripe connect? Can you provide more details about your integration?

verbal ermine
#

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

hard fog
verbal ermine
#

True, So when I hit the checkbox, I want the cardnumber Element to be with merchant_ID, how can I do this?

hard fog
#

AFAIK you'd need to reinitialize, let me check if we have some docs on this

tardy wave
#

correct you have to reload the whole page

#

Basically you should always know the account id before rendering Elements

verbal ermine
#

so can u pls tell me how can I reload the page in this case?

tardy wave
#

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

verbal ermine
#

How can I mount it again?

tardy wave
#

Sorry I'm not sure how else to explain it. You write code that mount the element, just from a different Javascript instance

verbal ermine
#

How to get elements from stripeObject?

tardy wave
#

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.

verbal ermine
#

I mean I get the stripeObject after loadStripe(), right? So using this stripeObject, can I get the elements?

tardy wave
#

not really?

#

I'm really sorry I feel like you're missing something really simple