#ravenheartz_card-element-icon
1 messages ยท Page 1 of 1 (latest)
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.
- ravenheartz_card-element-icon, 16 minutes ago, 7 messages
๐ 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/1234499639210676267
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
I'm not able to reproduce that error. Can you tell me more about your integration? Are you pulling stripe.js directly from us?
yes, that's how we retrieve the JS file:
<script src="https://js.stripe.com/v3/?ver=3.0" id="stripe-js"></script>
Is there a page I can access to observe this?
For example, you can observe hideIcon: true woring as expected for the combined card element here: https://jsfiddle.net/nolanhawkins/420bmzn6/1/
Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor.
And you can see showIcon: true in this split-field example: https://jsfiddle.net/nolanhawkins/xm71u2pd/
Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor.
Can you share a reproduction like that which produces the integration error you see?
Is it possible you're passing this options into stripe.elements();?
Ok, yes, I suspect this is what you are doing, because I get exactly the error you shared if I add the options to that call
But this is expected because those options are not meant for elements()
ravenheartz_card-element-icon
oh, so how should I pass this option?
in elements.create() -- like your initial snippets showed
that's where I am passing the option to
stripe.elements() and elements.create() are two separate (but related) functions
Can you share your entire stripe.js init code?
yes, 1 sec please
var stripe = Stripe( '**key**', {
locale: 'auto',
} );
var elements = stripe.elements(),
stripe_card,
stripe_exp,
stripe_cvc;
if ( 'yes' === '**is inline CC form**' ) {
stripe_card = elements.create( 'card', { hidePostalCode: true, hideIcon: true } );
} else {
stripe_card = elements.create('cardNumber', { showIcon: false});
stripe_exp = elements.create('cardExpiry');
stripe_cvc = elements.create('cardCvc');
}
OK, given that code the error does not appear make sense
Is there somewhere i can look online and observe what you describe directly?
tried again and the error stopped, but the icon is still showing up ๐ค
I will share my env, 1 sec
you can add a product to your cart and go to the checkout page
all I need is to disable this
more context: co-badged cards are not supported when sources API is being used, and this version uses the sources API
the card brand selection. I thought that disabling the icon was the only way
is there another way?
Ah yeah okay sorry that is the correct way if you aren't going to use preferredNetwork
Can you remove the other options you are passing to elements.create('cardNumber'...?
And just pass showIcon: false?
let me try
done. The icon is still showing up. I tried to add an alert to the file just to make sure it is being called (it is)
Testing again on my end, one sec.
Hmm yeah that is very strange... it clearly works fine on the Fiddle my colleague shared above
maybe a cache issue? Or a version issue?
Ah you are setting https://js.stripe.com/v3/?ver=3.0 -- try just <script src="https://js.stripe.com/v3/"></script>
Don't think that should really matter tbh
But worth checking
this is a default behavior for wordpress. I replaced it with a random value (to force the cache to update), and got the same result
Hmm okay give me a few more minutes to look
(We are still looking)
it is ok, thanks. I can wait
Okay we have a theory that the WooCommerce plugin is still controlling this CardNumber Element. So while your code is running, that isn't actually what is being mounted here.
What if you set disabled: true on your CardNumber Element?
Does that actually get set? Or does nothing happen?
no change. So yeah, your theory may be true
Yeah okay so it seems you are going to need to investigate how to override the WC plugin here to be able to control your own Elements
I will do some digging here. Thanks for your help so far! I can open another thread later if I still need help
๐