#whatisthis3247
1 messages ยท Page 1 of 1 (latest)
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')
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
ummm, but where is const paymentElement = elements.create('payment')?
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
hmmm, give me a while to try it out on locally and I'll get back to you
thanks so much i appreciate it a lot
just so you know, i'm still prodding your code, i'm able to replicate the issue with your code
okay, this is....interesting....can you try changing this variable name : stripeV3Elements to elements and see if you're still encountering the same issue
i'm just as stunned haha
i had to fix a couple other things to confirm but it worked...! wow!
anyway, it's a relief that we manage to get things working...although it's admittedly weird
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 ;))
i'll check in with the team about this weird issue, i don't know about the tee though ๐
sounds good thanks again ๐