Skip to content

Paypal not working for the logged in customer console error showing “Uncaught TypeError: Cannot read properties of undefined (reading ‘done’) “

I am facing a strange issue, when a logged customer wants to place an order with Paypal then it is showing an error in the console but with guest checkout, it is working perfectly.

I have checked the file “vendor/magento/module-paypal/view/frontend/web/js/view/payment/method-rendererpaypal-express-abstract.js” and found below code.

/** Redirect to paypal */
    continueToPayPal: function () {
        if (additionalValidators.validate()) {
            //update payment method information if additional data was changed
            this.selectPaymentMethod();
            setPaymentMethodAction(this.messageContainer).done(
                function () {
                    customerData.invalidate(['cart']);
                    $.mage.redirect(
                        window.checkoutConfig.payment.paypalExpress.redirectUrl[quote.paymentMethod().method]
                    );
                }
            );
            

            return false;
        }
    }

Can anyone please help me ?

If I comment “setPaymentMethodAction(this.messageContainer).done()” function then will it work and will not create any other issue ?

Magento version :- 2.3.4

enter image description here