magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.5k stars 9.31k forks source link

Shipping address missing after canceled payment redirect to checkout/#payment #11247

Closed wintermute-84 closed 6 years ago

wintermute-84 commented 7 years ago

This issue was reported multiple times and every ticket is closed. Like #5959

Preconditions

  1. Latest Magento 2.2.0
  2. Payment method that uses redirected payment page
  3. Ability to cancel payment to get back to checkout

Steps to reproduce

  1. Add product
  2. Go to checkout, fill shipping address, go to the next step
  3. Click pay with 3rd party payment provider
  4. Cancel payment to get back to /checkout/#payment

Actual result

The shipping address is not loaded. Address is still present in db. Other quote info like products/prices are loaded. screen shot 2017-09-20 at 13 28 51

Cancel action is standard:

public function execute()
    {
        $this->checkoutHelper->cancelCurrentOrder('');
        $this->checkoutHelper->restoreQuote();

        $this->_redirect('checkout', ['_fragment' => 'payment']);
    }

If anyone has any fixes to this, please help. Referenced commit in other tickets: https://github.com/magento/magento2/commit/63ff3aee27a7d5830221aa6a2bf92f4bd88c56ef not only is missing from 2.2 but also does not fix it.

magento-engcom-team commented 7 years ago

@wintermute-84 We cannot reproduce this issue as described. Please provide the detailed steps we must follow to reproduce this issue. In addition, what payment method do you use, and any other information needed to reproduce your issue.

reihaan commented 6 years ago

I am also facing same issue, when we cancel the payment it take us to cart instead of checkout page and all the fields get emptied. The issue exists in Magento Community Edition 2.2.0

Also when we refresh the checkout page we see the same behavior.

wintermute-84 commented 6 years ago

If you use CreditCard (QuickPay) as payment method and just cancel your payment on the HPP it will redirect back to checkout purging shipping address. You can debug JS that is loading the address.

Or you can use Adyen HPP with the same result as @reihaan has. It will redirect to cart and after proceeding to checkout you will see that shipping is empty.

Also I'm pretty sure that using Paypal\Hostedpro will have the same result but I don't have an account to verify it.

In all cases quote address is present in the DB.

And I'm also curious how have you tested/ with what payment method that you didn't get it to fail.

magento-engcom-team commented 6 years ago

@wintermute-84, thank you for your report. We've created internal ticket(s) MAGETWO-82589 to track progress on the issue.

magento-engcom-team commented 6 years ago

@wintermute-84, thank you for your report. The issue is already fixed in 2.2.4

richardechidna commented 6 years ago

Where can I find the code for this ?

kapil019 commented 6 years ago

@richardechidna I have fixed this in https://github.com/magento/magento2/issues/11197#issuecomment-359785930 Please check my commit https://github.com/kapil019/magento2/commit/108c3fac3d5bde3353433199359582e7bf7cea0f

richardechidna commented 6 years ago

@kapil019 thanks bro, but the code seem not to be working. My issue is after i fill in the shipment address and proceed to the payment section and then after refresh while being at payment section the shipping data gets removed

brekz commented 6 years ago

Yes, I'm getting the same issue, as @richardechidna described. Any solution?

richardechidna commented 6 years ago

@brekz unfortunately not yet. we are waiting on Magento's help. Will post it once we get it

mvaisberg commented 6 years ago

Any update here? i am having the same issue.

tig-robertgrundeken commented 6 years ago

Still having the problem with branch 2.2.4-preview. Is it already merged in there?

peterjaap commented 6 years ago

Also having this issue. The fix @kapil019 described is for when you use the step navigator at the top to go back and forth a page (as described here), not for the bug that occurs when refreshing the payment page or hitting the back button in your browser.

fk-whothat commented 6 years ago

Any update having the same issue at magento v2.2.2

elvinristi commented 6 years ago

@fk-whothat, if you know how to add patches then maybe you can try this one for Magento_Checkout to apply and see if it fixes issue for you?

worldnettps commented 2 years ago

This still happening in v2.4.2 The only difference in our payment flow is that the cartManagement->placeOrder method is called only when the gateway returns a successful payment. Otherwise the quote is kept active and user gets redirected to the payment page. The quote information is correct, it just seems that the checkout-data in the localstorage gets emptied and the quote shipping address is not correctly populated, resulting in the same issue originaly posted. This only happens for guest checkout. Is there an open issue for this?