News:

Support the VirtueMart project and become a member

Main Menu

Return to merchant site - Error - Login

Started by kacie_23, March 08, 2021, 14:21:27 PM

Previous topic - Next topic

kacie_23

Every time I complete a payment, I am returned to my site, but to the login-page.


Error
Please login first


If I provide log-in details, the return URL is the input, but without the return array provided by PayPal.
This array will probably provide me with the "Payment Confirmation"

I have had this problem for quite some time now, and I have been checking the firewall.
Cannot see any problems there. Not from my knowledge, but I am open to do some more research here.
The site is not Public, but requires you to be logged in (Registered), but I cannot really understand that this should be an issue.

I have tested the IPN simulator, with some negative results --> cannot handshake, but again I cannot find anything in my Firewall that could cause this.

How do you proceed to find out what the problem is. What ports are used? Do you need to use https? Etc.... anything is welcomed :)

Thank you!





Jörgen

To little information.

VM, Php, Joomla version, added extension etc ???

Jörgen
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

GJC Web Design

QuoteThe site is not Public, but requires you to be logged in (Registered), but I cannot really understand that this should be an issue.

So you mean the return from Paypal to your site after a successful payment?

If your site is registered only then as the return url is just a simple html return then I would assume that it would simply redirect to a login.
the return is simply
index.php?option=com_virtuemart&view=vmplg&task=pluginresponsereceived&on=123&pm=123&Itemid=123

and coming from Paypal who obviously are not logged in.. struggling to think of a solution
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

kacie_23

#3
After I log in the return URL is provided as follows:

https://www.mysite.com/index.php?option=com_virtuemart&view=vmplg&task=pluginresponsereceived&on=XXXXX&pm=2&Itemid=XXX&lang=en-GB&PayerID=XXXXXXXX

I have also thought that PayPal is providing the redirect URL, but I cannot really comprehend this.
The redirect URL is entered into my browser, and I should be logged in already.

Could this have something to do with session variables, not provided by the redirect URL ???

SOLUTION (partial): I tested the following :


  • I listed my shop as Public (not Registered)
  • I tried the "return to merchant site", button
  • Both the above was tested in sandbox, with a hardcoded return URL, and with a live payment without a hardcoded return URL

This actually worked for the sandbox, with an hardcoded return URL, but not for the live environment without an hardcoded return URL.
I will retest the above to verify.

The question now is why? ....
I belive this question need a proper solution.
Because I did test the following without being logged in:


Both works without being logged in, and indicates that something is wrong ..... but what?

Additional information :

From the /var/log/httpd/ssl_access_log  :

notify.paypal.com - - [10/Mar/2021:13:51:37 +0100] "POST /index.php?option=com_virtuemart&view=vmplg&task=notify HTTP/1.1" 403

The notifier seem to return 403 to PayPal, and it will explain why the IPN simulator at PayPal does not work.
I did find an indication of some solution here at GJC webdesign https://www.gjcwebdesign.com/joomla-virtuemart-tips/331-enable-virtuemart-paypal-notifications-when-administrator-folder-is-htaccess-protected.html .

I cannot really find the notifier at the location they specify, so this seem to be a bit hard to comprehend.





For information -------------
PHP Version   7.4.15
Web Server   Apache/2.4.37 (centos) OpenSSL/1.1.1g mod_fcgid/2.3.9
Joomla! Version   Joomla! 3.9.8 Stable [ Amani ] 11-June-2019 20:00 GMT
VM : VirtueMart 3.4.2

jenkinhill

VM3.4.2 is over 2 years old. Have you thought about trying a more recent version? The PayPal plugin has been updated as well.

Current versions are Joomla 3.9.25 and VirtueMart 3.8.9
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

kacie_23

#5
Thank you jenkinhill,

I belive that my question is related to other problems than the Version number.
Last time I tried to update VM my site went down for 3 months, due to some unknown core changes my plugins and modules did not like (or the opposite).

But I was able to find a solution to the IPN problems from PayPal:

https://www.paypal.com/us/smarthelp/article/what-are-the-ip-addresses-for-live-paypal-servers-ts1056

An advice to anyone having IPN problems..... check the access logs (either ssl or the common access_log), your firewall and your apache config file for any Deny, Allow rules that blocks the incoming notify.paypal.com messages.


I assume that the login problem might be due to something similar. I will post the solution when I find this out.

Again, thank you for your suggestions.

The problem was not easy to solve, and I belive that the plugin should have had some logging implemented in the code.
I found the solution by inserting :


function plgVmOnPaymentNotification() {

                $paypal_data = $_POST;

                //Modifications - TODO ---- logg all IPN Paypal data

                $file = '/var/www/html/logs/postdata.log';                  //Add a file to the standard virtuemart log output
                $current = file_get_contents($file);                            //Get the current file content
                $string_data = print_r($paypal_data, true);                //Specify the paypal_data in an nicely formatted array
                $currentDateTime = date('Y-m-d H:i:s');                     //Insert a timestamp
                $current .= $currentDateTime.' - '.$string_data."\n";   //Append the timestamp and data
                file_put_contents($file, $current);                              //Write to file
   

The first thing I noticed was that i did not receive the data......
Then I started to look in my firewall, access logs, and apache config for any problems with access to my site.

Suddenly I received data in the log...... and the IPN system was up and running.