paytm / Paytm_Magento_Plugin

https://developer.paytm.com/docs/eCommerce-plugin/magento/
2 stars 8 forks source link

Redirecting to Empty Cart after successful payment instead of order confirmation #2

Closed pratheekn91 closed 3 years ago

pratheekn91 commented 4 years ago

HP cURL Version: 7.52.1 Magento Version: 2.3.4 Paytm Plugin Version: 2.0 Using the Porto theme

After successful payment, expected outcome is order confirmation page is displayed with order number.

Issue is after successful payment, customer is redirected to empty cart and Paytm Payment success message is displayed with no order confirmation or order number.

Tough to recreate as it happen inconsistently, around 60% of the times only. Usually happens if customer takes too long to make payment.

Im using other payment modules too and happens only for Paytm payments.

vishalpatel19862 commented 4 years ago

@pratheekn91 I am also facing same issue. It's because of google chrome browser's 'SameSite cookie' policy. Have you found any solution?

pratheekn91 commented 4 years ago

No idea how same site policy causes this issue. But il check and see.

I Didn't try finding a solution for this as I didn't have the time. I'm using alternate payment gateway which is not giving any issues. Il wait for the developers to fix this and get back to using Paytm.

Could be because payments are taking too long and by the time the user comes back to the site, Magento session environment is expired.

vishalpatel19862 commented 4 years ago

I had written email to Paytm support. they responded saying that issue is due to Chrome's policy change. I am using CCavenue and having similar issue with CCavenue as well.

pratheekn91 commented 4 years ago

I'm using razorpay with their stock magento plugin and have not recived any issues so far.

Let me check again and let me know if I can recreate the same issue with razorpay plugin on chrome.

In the meantime can you confirm exactly which policy change is causing this issue?

Regards, Pratheek, Probots, www.probots.co.in Ph: 9008620582

On Thu, 1 Oct, 2020, 8:31 pm vishal, notifications@github.com wrote:

I had written email to Paytm support. they responded saying that issue is due to Chrome's policy change. I am using CCavenue and having similar issue with CCavenue as well.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/paytm/Paytm_Magento_Plugin/issues/2#issuecomment-702196656, or unsubscribe https://github.com/notifications/unsubscribe-auth/APZGUKDGMZ5LEAUOTIGGNZ3SISKVRANCNFSM4QL5WVQA .

vishalpatel19862 commented 4 years ago

As per new google chrome policy any third party module which is exchanging information between two different domain then it needs to have 'SameSite' cookie and requires to set value as None and label it as Secure. If cookie and it's value is not updated as per new policy then it will not work.

Jeeva-Rathinam commented 4 years ago

@vishalpatel19862 Any hep thanks https://github.com/paytm/Paytm_Magento_Plugin/issues/3

vishalpatel19862 commented 4 years ago

So far issue is not resolved. Paytm support team responded saying that our team is working to fix issue. They have not given any timeline so i have decided to disable.

manikumaran1978 commented 3 years ago

We have same problem. Only paytm success message without order number. Also, there is no email is being sent to customer. Customer is getting confused whether order is confirmed or not paytm

pratheekn91 commented 3 years ago

We have same problem. Only paytm success message without order number. Also, there is no email is being sent to customer. Customer is getting confused whether order is confirmed or not paytm

The Paytm extension does not support the latest 2.4

So it's best to not use it now.

You will have to implement the API yourself till Paytm updates this extension to support the latest magento 2.4 version

Knight017 commented 3 years ago

Same issue with Amazon Payment , and there is one discussion related to {{block}} directive which may be reason here also. Not sure this will help or not, it worked for me.

I've commented the code which was sending the mail after order in One97\Paytm\Observer\SendMailOnOrderSuccess.php however as @pratheekn91 mentioned in the first comment it is happening in 60% cases only. I've tested in some cases it working as of now.

Mostly it seems the reason only, will need to update email template to fix this.

Knight017 commented 3 years ago

We are still observing this issue, with below implementation, however it is quite less, but still this is not a proper solution

Fixed the issue by updating the cms block calling {{block}} directive by following stackoverflow question Magento2 checkout/onepage/success redirects to cart

Reason explained by Paj

If you use blocks in your email templates to load content from cms or phtml templates into new order emails this can cause an issue where the call to the block destroys the customer session when the new order email is sent. This means when you return to the site after successful third party payment i.e. PayPal there is no session data and the customer is redirected to an empty cart.

Solution given by Andrej Wasemiller

This was with us after the PayPalPlus order, because of the static block in the email template.

instead of this in email template:

{{block cacheable="false" id="terms"}} I created sales_email_order_terms.xml in Custom_Theme/Magento_Sales/layout.

terms

and then use in email template:

{{layout handle="sales_email_order_terms"}}

abpaytm commented 3 years ago

Hi , Please use our latest plugin . https://github.com/paytm/Paytm_Magento_Plugin or download from magento market

abpaytm commented 3 years ago

Please try our latest plugin . If still you face any issue please mail to cmt.ops@paytm.com