#ravenheartz_card-element-icon

1 messages ยท Page 1 of 1 (latest)

sly veldtBOT
brazen pendantBOT
#

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.

sly veldtBOT
#

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

glacial summit
#

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>
brazen pendantBOT
molten canyon
#

Is there a page I can access to observe this?

#

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()

sly veldtBOT
#

ravenheartz_card-element-icon

glacial summit
#

oh, so how should I pass this option?

brazen pendantBOT
molten canyon
#

in elements.create() -- like your initial snippets showed

glacial summit
#

that's where I am passing the option to

molten canyon
#

stripe.elements() and elements.create() are two separate (but related) functions

#

Can you share your entire stripe.js init code?

glacial summit
#

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');
}
molten canyon
#

OK, given that code the error does not appear make sense

#

Is there somewhere i can look online and observe what you describe directly?

glacial summit
#

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

ruby remnant
#

๐Ÿ‘‹ stepping in here

#

Give me a moment to catch up

glacial summit
#

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

ruby remnant
#

Wait so you want to disable the card brand selection?

#

Or the icon from showing?

glacial summit
#

the card brand selection. I thought that disabling the icon was the only way

#

is there another way?

ruby remnant
#

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?

glacial summit
#

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)

ruby remnant
#

Testing again on my end, one sec.

#

Hmm yeah that is very strange... it clearly works fine on the Fiddle my colleague shared above

glacial summit
#

maybe a cache issue? Or a version issue?

ruby remnant
#

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

glacial summit
#

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

ruby remnant
#

Hmm okay give me a few more minutes to look

ruby remnant
#

(We are still looking)

glacial summit
#

it is ok, thanks. I can wait

ruby remnant
#

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?

glacial summit
#

no change. So yeah, your theory may be true

ruby remnant
#

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

glacial summit
#

I will do some digging here. Thanks for your help so far! I can open another thread later if I still need help

ruby remnant
#

๐Ÿ‘