#kwac.

1 messages · Page 1 of 1 (latest)

twilit shardBOT
#

Hello! We'll be with you shortly. 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.

sleek stirrup
#

`
public function include_stripe_js() {
?>
<script src="https://js.stripe.com/v3/"></script>
<script>
var stripe = Stripe('');
var elements = stripe.elements();
var card = elements.create('card');
card.mount('#stripe-card-element');

            </script>
            <?php
    }

`

late crater
#

Please delete your key from here

#

Do you have a screen recording or a URL to reproduce the issue?

#

Do you see any errors in the console?

sleek stirrup
#

Wait I will provide screenshots

late crater
sleek stirrup
#

Sometimes I get this error message - 'controller-cc848a9ad…2497a003323d67.js:1 [Stripe.js] The selector you specified (#stripe-card-element) applies to 2 DOM elements that are currently on the page. The Stripe Element will be mounted to the first one.'

late crater
#

I think this is just a warning.

sleek stirrup
late crater
sleek stirrup
late crater
#

This doesn't look like Stripe Card Element.

sleek stirrup
#

in js code?

late crater
#

On the screenshot

sleek stirrup
#

Alright, so I removed the code and replaced with this only element

<div id="stripe-card-element" class="wc-stripe-elements-field"> <!-- a Stripe Element will be inserted here. --> </div>

it still appears then disappears

sleek stirrup
#

do i need to write the elements differently?

sleek stirrup
#

Is this correct declaration? Do I need to echo client secret in options = { client_secret:

late crater
#

Are you following the doc I shared?

sleek stirrup
#

yes

late crater
#

You need to load the client secret from your backend when you create the PaymentIntent

sleek stirrup
#

load it from this? did i even put those keys correctly

late crater
#

That's not the Client ID.

#

You only need the Secret Key on the backend.

#

What programming language are you using?

sleek stirrup
#

PHP

late crater
#

For what exactly?

#

In any case, pk_test_xxx is not a client ID.

sleek stirrup
#

Okay I might return later, I will try to get this fixed