Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when trying to check out #118

Open
nikhil-1911 opened this issue Apr 24, 2023 · 2 comments
Open

Error when trying to check out #118

nikhil-1911 opened this issue Apr 24, 2023 · 2 comments

Comments

@nikhil-1911
Copy link

image
Getting this error in /checkout page. I have configured test stripe public key as well as secret in medusa admin.
Can you please look into this? Thanks!

@kasperkristensen
Copy link
Collaborator

Hi @nikhil-1911,

Can't replicate the issue when testing on the latest version of the main branch. Have you made any customizations to the storefront?

@felipemullen
Copy link

I came across this issue as well. From my understanding it happens when the stripe component is remounted incorrectly, caused by the implementation of the stripe react package.

I ended up fixing it by adding the key prop to the Elements component inside StripeWrapper in storefront/src/modules/checkout/components/payment-wrapper/index.tsx:

const StripeWrapper: React.FC<WrapperProps> = ({ paymentSession, children }) => {
    const clientSecret = paymentSession!.data.client_secret as string | undefined;
    const options: StripeElementsOptions = {
        clientSecret
    };

    return (
        <Elements stripe={stripePromise} options={options} key={clientSecret}>
            {children}
        </Elements>
    );
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants