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 on completion: "Call to complete() was ignored because it has already been called. Do not call complete more than once." #26

Open
hassanmah opened this issue Jan 5, 2022 · 5 comments

Comments

@hassanmah
Copy link

hassanmah commented Jan 5, 2022

Hey, I get the following error in console when payment is completed and it stops the page from redirecting.

Call to complete() was ignored because it has already been called. Do not call complete more than once.

My code is as follows

{{ craft.webPayments.button({ cart: craft.commerce.carts.cart, requestDetails: ['name', 'phone'], onComplete: { redirect: '/shop/checkout/order/number={number}', js: 'window.paymentCompleted(cwp.number);', }, requestShipping: 'delivery', style: { height: '52px', } }) }}

Anyone come across this before?

Thanks

@Tam
Copy link
Member

Tam commented Jan 6, 2022

Can you share what network requests are sent to Stripe?

@hassanmah
Copy link
Author

hassanmah commented Jan 6, 2022

@Tam This is what I see in console:

image

This is what comes up when I click on the error:

image

Thanks

PS. Can I email you the requests as it's a sensitive project and screenshots expose the URL.

@Tam
Copy link
Member

Tam commented Jan 6, 2022

@hassanmah You can email [email protected]

@goodmixer
Copy link

Having similar issue with page not redirecting after payment.

{{ craft.webPayments.button({
style: {
theme: 'light-outline',
height: '64px'
},
cart: craft.commerce.carts.cart,
requestShipping: false,
onComplete: {
redirect: '/shop/customer/order?number={number}',
js: 'window.paymentCompleted(cwp.number);',
},
}) }}

@cole007
Copy link

cole007 commented Feb 12, 2024

Hi.

We're experiencing a similar issue (Craft Pro 4.7.1 with Craft Commerce 4.4.1.1, Stripe for Craft Commerce 4.1.1 and Web Payments | 4.0.0).

Web payments not completing and after modal pop-up (in browser scenario) user is returned to the payment page as if nothing has happened. In the back-end under the cart (Orders > Attempted Payments) I can see a transaction has been attempted with a status of Redirected but with A Gateway Code of null.

As with others the browser console says

Call to complete() was ignored because it has already been called. Do not call complete more than once.

Any thoughts on resolving?

Cole

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

4 participants