#Ian-Payment-Elements

1 messages · Page 1 of 1 (latest)

frigid willow
#

Hi there

#

That's very strange

#

Do you have this live anywhere that I could test it?

#

Or are you testing locally?

unique moat
#

im testing locally

#

i tried it there first

#

and discovered the issue

frigid willow
unique moat
#

i had a colleuge walk through it and he couldnt reproduce it

#

but you can

#
  1. select an option and click the free trial checkbox. add to cart.
#
  1. click the checkout button
#
  1. on the cart/confirm page enter payment info and agree to the terms
#

the issue occurs when i submit the checkout form

#

does that help?

#

ive had a couple of people do it successfully so it might be an issue specific to me

frigid willow
#

You've had a couple people reproduce it? Or you were the only one to reproduce?

#

Do you have preventDefault in your code?

#

Can you show me your submit handler?

unique moat
#

im the only one who can produce it

#

yes i preventDefault

#
async handleSubmit(e, intentType) {

        e.preventDefault();

        this.trigger('payment-element-submitting', true);

        const { elements } = this.state;

        if (!this.props || !elements) {

            throw Error('submit error');
        }

        let returnUrl: string | undefined;
        let error: StripeError | { message: string;} | undefined;

        switch (intentType) {

            case 'paymentIntent':

                returnUrl =  `${window.location.origin}/cart/success/${this.props.stripeCustomerId}/${this.props.invoiceId}`;
                ({ error } = await this.handlePayment(elements, this.props, returnUrl));

                break;

            case 'setupIntent':

                returnUrl = `${window.location.origin}/trial/success/${this.props.stripeCustomerId}`;
                ({ error } = await this.handleSetup(elements, this.props, returnUrl));
                break;

            default:
                // sets custom error message if something unexpected goes wrong
                error = { message: 'Unable to process client secret' };
        }

#

not sure how helpful it is but i call the stripe client methods inside the case statement

frigid willow
#

Can you share your handleSetup code?

unique moat
#
    handleSetup(elements: StripeElements, props: PaymentElementProps, url: string) {

        if (this.state.selectedPaymentMethod) {

            // confirmCardSetup will not redirect by default so it will return a result with no error
            return this.state.stripeClient.confirmCardSetup(props.clientSecret, {
                payment_method: this.state.selectedPaymentMethod,
                return_url: url,
            });
        }

        return this.state.stripeClient.confirmSetup({
            elements,
            confirmParams: {
                return_url: url,
            },
        });
    },
#

the most common code path is outside of the if statement. that is what is causing issues for me

#

i dont know much about firefoxes partitioned storage api but i get those warnings in the console with the stripe libarary

#

thats a difference i notice between firefox and other browsers

frigid willow
#

Do you have a test email/pw I can use on your site?

unique moat
#

Control1!

frigid willow
#

Hmm okay I was able to reproduce what you stated

#

Interesting.

#

Alright give me a few mins to take a look at this with a teammate

unique moat
#

its interesting that no errors are returned

frigid willow
#

What version of Firefox are you on?

unique moat
#

103.0.2

unique moat
#

my collegue is using an old version. 87

frigid willow
#

And they couldn't repro it, correct?

#

We are still looking btw

#

This is quite odd

unique moat
#

they could not reproduce on 87

frigid willow
#

@unique moat so far we are stumped here. Clearly for some reason Firefox is performing navigation upon confirmSetup but we can't quite figure out why. This is going to take some further debugging on our end... can you shoot an email to our Support team via https://support.stripe.com/contact/login and mention my handle (bismarck) in the email and let me know when you have sent it? Then I can grab the ticket and follow up with you over email later today.