#whatisthis3247

1 messages ยท Page 1 of 1 (latest)

foggy islandBOT
latent lodge
#

Hello! give me a while to get back to you

#

Looking at your gist, i'm not certain if this is your full code, but you're missing some stuff i.e. I'm not seeing this section https://stripe.com/docs/payments/accept-a-payment-deferred?platform=web&type=setup#add-the-payment-element-to-your-checkout-page

const options = {
  mode: 'setup',
  currency: 'usd',
  // Fully customizable with appearance API.
  appearance: {/*...*/},
};

// Set up Stripe.js and Elements to use in checkout form
const elements = stripe.elements(options);

// Create and mount the Payment Element
const paymentElement = elements.create('payment')

Build an integration where you can render the Payment Element prior to creating a PaymentIntent or SetupIntent.

summer ferry
#

it shou ld be the first two lines of the jS
var stripeV3 = Stripe('pk_test_51J04nLFKBbTx6fUeIGvxhXs6a0LQppp2oFZChMqYP7MAbl7oOh4zkk7MuZNGpH8GfHcfjE4Yl9EOZbSpyZE78XID00uFFEIsr4');
var stripeV3Elements = stripeV3.elements({"mode":"setup","setupFutureUsage":"off_session","currency":"cad"});

#

i have tried removing setupFutureUsage as well and got same error btw

latent lodge
#

ummm, but where is const paymentElement = elements.create('payment')?

summer ferry
#

oh sorry i missed that code in the gist because it happens a little later

        var stripeElementsLocal = stripeV3Elements;
        var paymentElement = stripeElementsLocal.create('payment', {"fields":{"billingDetails":{"address":"never"}}});
        paymentElement.mount('#edit_stripe_payment_element');
#

fyi the card collection form seems to shwo up ok. i put in a test card number like 4242 4242 4242 4242 and when is ubmit the form that's when that error occurs

latent lodge
#

hmmm, give me a while to try it out on locally and I'll get back to you

summer ferry
#

thanks so much i appreciate it a lot

latent lodge
#

just so you know, i'm still prodding your code, i'm able to replicate the issue with your code

latent lodge
#

okay, this is....interesting....can you try changing this variable name : stripeV3Elements to elements and see if you're still encountering the same issue

summer ferry
#

Sure give me 1 min

#

omg it worked...

latent lodge
#

i'm just as stunned haha

summer ferry
#

i had to fix a couple other things to confirm but it worked...! wow!

latent lodge
#

anyway, it's a relief that we manage to get things working...although it's admittedly weird

summer ferry
#

yea thank you so much for your help. I use that var name when doing paymentIntent without an issue so i wonder if it's a stripe bug (if so do I get another shirt? Last one I got was many many years ago ;))

latent lodge
#

i'll check in with the team about this weird issue, i don't know about the tee though ๐Ÿ˜…

summer ferry
#

sounds good thanks again ๐Ÿ™‚