View Issue Details

IDProjectCategoryView StatusLast Update
0007334module Amazon Paymainpublic2022-07-21 13:09
Reporter[email protected] Assigned To 
PriorityhighSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
Fixed in Version1.2.0 
Summary0007334: Amazon Pay bug: Basket gets lost if AmazonPay user exists already
DescriptionThere is an unexpected behavior caused by the Amazon Pay module in the latest version (https://github.com/OXID-eSales/amazon-pay-module/tree/v1.1.3).
When you get redirected from Amazon back to your shop and the user can't be registered because there already is an user with the same email address and a password, the basket gets deleted.
Steps To Reproduce- create an account in the shop with the same email address as your amazon account (user with password)
- logout from the shop
- add a product to the basket
- go to basket page
- click the Amazon Pay button to get redirected to the Amazon login page
- login with your Amazon account
- click "continue to checkout" to get redirected to the shop
- you get to the user page (checkout step 2) and the error page "An account already exists for email address..." shows up
- during the page load the logout function from OXID was called and the basket was deleted
Additional InformationCould be fixed with the following changes in the method UserComponent::createGuestUser()

        // before $this->registerUser() has been called
        $basket = Registry::getSession()->getBasket();
        
        // existing code: basket will be deleted if user registration failed
        $registrationResult = $this->registerUser();
        
        // after $this->registerUser() was called
        if (!$registrationResult && $basket && $basket->getProductsCount() > 0) {
            $basket->resetUserInfo();
            $basket->onUpdate();
            Registry::getSession()->setBasket($basket);
        }
TagsNo tags attached.

Activities

mario_lorenz

2022-07-21 13:08

developer   ~0013932

Thanks for the report and your solution. I´ve solved in a small other way. Please checkout v1.2.0