VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: chancehoggan on October 28, 2011, 16:42:50 PM

Title: Paypal IPN Notification
Post by: chancehoggan on October 28, 2011, 16:42:50 PM
I get this error and have no idea how to fix it:

Hello abc abc,

Please check your server that handles PayPal Instant Payment Notifications (IPN). IPNs sent to the following URL(s) are failing:

http://www.website.com/administrator/components/com_virtuemart/notify.php

If you do not recognize this URL, you may be using a service provider that is using IPN on your behalf. Please contact your service provider with the above information. If this problem continues, IPNs may be disabled for your account.

Thank you for your prompt attention to this issue.


Thanks,

PayPal
Title: Re: Paypal IPN Notification
Post by: alatak on October 28, 2011, 17:17:56 PM
Hi,

How do you get that?
This IPN URL does not exist in VM2.
Title: Re: Paypal IPN Notification
Post by: chancehoggan on October 28, 2011, 18:01:31 PM
Thats the url that the system is generating - do you know the right url?
Title: Re: Paypal IPN Notification
Post by: alatak on October 28, 2011, 18:10:31 PM
Hi,

Please be more specific.
This URL does not exist in VM2. It is an URL from VM1.
VirtueMart does not generate that URL.

What are you trying to do? Are you tring to test IPN notification via the IPN test tool?

If it is the case, please have a look here:
http://forum.virtuemart.net/index.php?topic=92050.0
Title: Re: Paypal IPN Notification
Post by: chancehoggan on October 28, 2011, 18:12:11 PM
I upgraded a site from vm1 to vm2 and everything works great.

Paypal keep sending the client an error message about notify.php not responding...

I think I need to specify the new url in paypal for VM2

I dont know what this url is?

Title: Re: Paypal IPN Notification
Post by: chancehoggan on October 28, 2011, 18:14:39 PM
I think i got the answer from the link you specified:

index.php?option=com_virtuemart&view=paymentresponse&task=paymentnotification&tmpl=component&pelement=paypal&pm="your order number"

Is this right?

Title: Re: Paypal IPN Notification
Post by: mitchie on November 24, 2011, 17:32:22 PM
Hallo,
I'm testing paypal plugin.

This thread looks like to one opened by milemaker on 21 October and like to one opened by nicole2292 on 20 November.
I'm getting the same result.

I'm working on online site (not local server), with paypal sandbox, joomla 1.7.3, vm 1.9.8RC2M.
Result I'm getting: Paypal accepts the payments, redirect to the merchant site, the site shows the Thank your for your order" message, the order number and the order import, the order status is still "pending", paypal transaction data are correctly saved into database.

I've tested the IPN itself.
I think a possible bug could be here:
message: plgVmOnPaymentNotification return new_statusArray
Please, note that "Array".
This message is generated by [root]/pluins/vmpayment/paypal/paypal.php line #452:
       if (strcmp($paypal_status, 'Completed') == 0) {
$new_status = $params->get('status_success');
    }

and inserted in the log file at line #457
   $this->logInfo('plgVmOnPaymentNotification return new_status' . $new_status, 'message');

Now, I receipt your (alatak) answer to nicole2292:
QuoteQuote

    As I said the return URL is http://www.mydomain.com/index.php?option=com_virtuemart&view=paymentresponse&task=paymentresponsereceived&pelement=paypal&pm=1

This is the retourn URL from paypa, but it is not this URL that will update the order status.
The order status is updated with a server-to-server call notification.

anyway (!) if the same function is used to get the order status on payment success (even via server-to-server), the db update could fails beacause it returns an array.
Maybe this is not the answer, but can you specify the function that is called to update the db?
You could also specify how the db is updated server-to-server. I'm really interested to know this point.

Thank you for your help.

BTW: that array is $new_status[0]=C.
Title: Re: Paypal IPN Notification
Post by: Joseph Kwan on November 25, 2011, 21:27:29 PM
Not sure why the orderstatus is set as multi-select field. Maybe the development team have their reasons. Anyway, try adding this line

            if (is_array($new_status)) $new_status=$new_status[0]; //bugfix by JK

after

      $new_status = $params->get('status_success');
Title: Re: Paypal IPN Notification
Post by: alatak on November 25, 2011, 21:49:26 PM
Hi,

I understand that you need a fix now. And probably the fix that you gave is correct.
It is true that i had not much time to check this problem those last days.

Anyway, he problem has been solved and fixed for the next version. I will double check before we actually do the release :)
Title: Re: Paypal IPN Notification
Post by: mitchie on November 27, 2011, 12:56:52 PM
Quote from: alatak on November 25, 2011, 21:49:26 PM
Hi,

I understand that you need a fix now. And probably the fix that you gave is correct.
It is true that i had not much time to check this problem those last days.

Anyway, he problem has been solved and fixed for the next version. I will double check before we actually do the release :)
Great news!
Thank you.

@Joseph Kwan: yes, I "fixed" like your advice but, as you say, I Dunno why the orderstatus is set as multi-select field. So I prefereed to report it as a bug to get an official answer and let the team have a look at it.
Thank you!
Title: Re: Paypal IPN Notification
Post by: alatak on November 27, 2011, 17:06:26 PM
Hi

Quote@Joseph Kwan: yes, I "fixed" like your advice but, as you say, I Dunno why the orderstatus is set as multi-select field. So I prefereed to report it as a bug to get an official answer and let the team have a look at it.
Thank you!

You are completly rigth.

The problem is in the file administrator/components/com_virtuemart/element/vmorderstate.php
replace this line
        return JHTML::_('select.genericlist', $fields, $control_name . '[' . $name . '][]', $class, 'value', 'text', $value, $control_name . $name);

by

        return JHTML::_('select.genericlist', $fields, $control_name . '[' . $name . ']', $class, 'value', 'text', $value, $control_name . $name);




Title: Re: Paypal IPN Notification
Post by: Joseph Kwan on November 29, 2011, 02:16:38 AM
This may cause problems somewhere when it is possible to select more than one order status. But I think you know better than I do whether multiselect order status is possible.
Title: Re: Paypal IPN Notification
Post by: alatak on November 29, 2011, 08:19:54 AM
Hi,

QuoteThis may cause problems somewhere when it is possible to select more than one order status.
Ofc. But this element is used in to specify what shall be the new status depending of events. I do not want a multiple select.

So the fix is correct.
Title: Re: Paypal IPN Notification
Post by: Joseph Kwan on November 29, 2011, 08:32:23 AM
I understand your point. My concern is whether the vmorderstatus element is used somewhere else. There is no indication that this element is only restricted to usage in paypal payment plugin. It can be used, for example, in the order list page where you can change the orderstatus in bulk. The name of the select field may need to include the square bracket [] to pass back an array.
Title: Re: Paypal IPN Notification
Post by: alatak on November 29, 2011, 08:41:58 AM
Hi,

QuoteI understand your point. My concern is whether the vmorderstatus element is used somewhere else.
It is an element, to be used by the xml files.
Not the select list used in to update the order status.
And even though, when the order status is updated, it is a single select, and not a multiselect in that case :)

QuoteThere is no indication that this element is only restricted to usage in paypal payment plugin.
vmorderstatus element can be used by all plugins: payment or shipment, custom, or shoppers, ...
Title: Re: Paypal IPN Notification
Post by: Joseph Kwan on November 29, 2011, 08:54:57 AM
Quote from: alatak on November 29, 2011, 08:41:58 AM
vmorderstatus element can be used by all plugins: payment or shipment, custom, or shoppers, ...

That is exactly the problem. Since the vmorderstatus can be used in other plugins, there may be possibilities that a multiselect dropdown is needed. If you are sure that no one will use it that way, that will be fine. Anyway, you are in the development team, not me.
Title: Re: Paypal IPN Notification
Post by: alatak on November 29, 2011, 09:06:29 AM
Hi,

QuoteThat is exactly the problem. Since the vmorderstatus can be used in other plugins, there may be possibilities that a multiselect dropdown is needed.
Anyway if one developper needs an multiselect, he can create his own element. That is not a problem.
Title: Re: Paypal IPN Notification
Post by: muddauber on December 26, 2011, 22:57:16 PM
So, which is the best fix to the problem?

I see one suggestion at:
http://wiki.opensource-excellence.com/index.php?title=How_do_I_allow_VirtueMart_IPN_to_work_on_my_website%3F

is to relocate the file. Your suggestion states to change the code.
PayPal sent me this warning, so I need to fix this ASAP:
"If you do not recognize this URL, you may be using a service provider that is using IPN on your behalf. Please contact your service provider with the above information.

Once you or your service provider fix this problem, you or your service provider can resend the failed messages from the IPN History page. If this problem continues, PayPal may disable the IPN feature for your account."
Title: Re: Paypal IPN Notification
Post by: alatak on December 27, 2011, 08:42:02 AM
Hi,

the suggestion refers to VM1 and not VM2.

The IPN in Virtuemart 2 f is:

    JROUTE::_(JURI::root() . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&tmpl=component'

Title: Re: Paypal IPN Notification
Post by: VampiRUS on December 28, 2011, 11:02:17 AM
paypal plugin try to work on every request index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&tmpl=component
and doesn't use 'pelement'
Title: Re: Paypal IPN Notification
Post by: sandstorm on February 13, 2012, 19:08:04 PM
I'm confused as to what should be input in the PayPal IPN settings.

Ive looked round the forum and seen a couple of entries from alatak.

Please can you confirm the latest URL to use for IPN.

Many Thanks
Title: Re: Paypal IPN Notification
Post by: alatak on February 13, 2012, 19:09:34 PM
Hi,

this one is the latest


       "notify_url" => JROUTE::_(JURI::root() . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&tmpl=component'),
Title: Re: Paypal IPN Notification
Post by: sandstorm on February 18, 2012, 11:27:18 AM
Ive added that IPN in Paypal as http://www.mysite.com/index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&tmpl=component

But now when I have made a payment and click the return to site via paypal I return to this error?

Notice: Undefined variable: payment_data in /home/sites/mynewsite.me.uk/public_html/blankets/plugins/vmpayment/paypal/paypal.php on line 300 Fatal error: Call to undefined method plgVmPaymentPaypal::_storePaypalnfos() in /home/sites/mynewsite.me.uk/public_html/blankets/plugins/vmpayment/paypal/paypal.php on line 310
Title: Re: Paypal IPN Notification
Post by: morktron on February 23, 2012, 01:00:30 AM
I've just tried out PayPal and got

Fatal error: Call to undefined method plgVmPaymentPaypal::_storePaypalnfos() in ***/plugins/vmpayment/paypal/paypal.php on line 310

after a successful order!

I thought all you had to do was put in a valid email address in admin and off you go, like in VM1, but obviously not!
Title: Re: Paypal IPN Notification
Post by: alatak on February 23, 2012, 11:15:19 AM
Hi,
Quote
Code: [Select]
Fatal error: Call to undefined method plgVmPaymentPaypal::_storePaypalnfos() in ***/plugins/vmpayment/paypal/paypal.php on line 310
you are probably using one of the test version.
If you are running 2.0.1, please update to the latest.
Title: Re: Paypal IPN Notification
Post by: olizan on June 29, 2012, 11:05:22 AM
Hello,

I have the same problem. I create a paypal account and i don't know where and what I must write in paypal, for notification (order status) in virtuemart.

actually here is my config paypal :    http://www.nom.com/index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&tmpl=component in instant notification

The order status don't change after an order completion.

could you help me ?

regards

Olivier
Title: Re: Paypal IPN Notification
Post by: freeme on July 11, 2012, 15:05:52 PM
VM 2.0.8c
Virtual Products 2.0.6 1.2

Same here: after successfull PayPal payment, no confirmation mail is sent out to the client. In the order status, it still says "pending".

What do I have to do to get this running? I think this is unsolved since the first release of VM2.
Title: Re: Paypal IPN Notification
Post by: copyman on October 16, 2012, 09:53:33 AM
same with me  :(
Title: Re: Paypal IPN Notification
Post by: hanuhp on December 18, 2012, 03:20:09 AM
Quote from: copyman on October 16, 2012, 09:53:33 AM
same with me  :(

Still the same this bug.
Where are the VM support?
please see this bug and fix for us???????????
Title: Re: Paypal IPN Notification
Post by: olizan on December 18, 2012, 09:03:13 AM
It's works if you enter this code in paypal : (yourwebsite must be online)

http://yourdomain/index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&tmpl=component
Title: Re: Paypal IPN Notification
Post by: lindapowers on April 19, 2013, 21:49:43 PM
We just noticed after 2 years that in our PayPal IPN settings we had set:

http://websitename.com/shop/ipn_main_handler.php

Which was the URL for zencart... but the strange thing is that is working, is that even possible?

Quote from: olizan on December 18, 2012, 09:03:13 AM
It's works if you enter this code in paypal : (yourwebsite must be online)

http://yourdomain/index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&tmpl=component

Shouldn't that be:

http://yourdomain.com/index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&tmpl=component

????
Title: Re: Paypal IPN Notification
Post by: jenkinhill on April 20, 2013, 10:57:23 AM
Shouldn't that be:

http://yourdomain.com/index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&tmpl=component

No, because I use   http://yourdomain.co.uk  or  http://yourdomain.biz  etc            ;)

As for the ipn url it sounds like one of those wierd things that you correct and then no longer works.
Title: Re: Paypal IPN Notification
Post by: lindapowers on April 20, 2013, 13:51:34 PM
Quote from: jenkinhill on April 20, 2013, 10:57:23 AM
Shouldn't that be:

http://yourdomain.com/index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&tmpl=component

No, because I use   http://yourdomain.co.uk  or  http://yourdomain.biz  etc            ;)

As for the ipn url it sounds like one of those wierd things that you correct and then no longer works.

:D yep

Actually we just left it the way it is, although that is for VM1, when we change to VM2 we will update the IPN's with the url mentioned and they won't work ;D
Title: Re: Paypal IPN Notification
Post by: carsten888 on April 22, 2013, 11:57:35 AM
QuoteWe just noticed after 2 years that in our PayPal IPN settings we had set:
Same here. After updating a few days ago to 2.0.20b (from 2.0.18 or so) payments did not get confirmed. Turns out I had Paypal point to a file that no longer existed since the update to Joomla 2.5.  :o

I just changed it to http://www.mydomain.com/index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&tmpl=component and am now waiting for the next payment to see what happens. (where is that popcorn-eating smiley?)
Title: Re: Paypal IPN Notification
Post by: carsten888 on April 22, 2013, 16:37:47 PM
darn! someone bought something, paid in paypal and again payment did not process in vm. ( I got the email from paypal, it was 2 hours ago, so manually set the order to confirmed).

I tried to direct access the url, which gives an empty page. In the code is the basic page without any content.

Webshop has been working fine for years, I do just another VM update and it stops working. There must be a reason.

Am I missing something obvious here?
Title: Re: Paypal IPN Notification
Post by: lindapowers on April 22, 2013, 20:48:23 PM
Quote from: carsten888 on April 22, 2013, 16:37:47 PM
darn! someone bought something, paid in paypal and again payment did not process in vm. ( I got the email from paypal, it was 2 hours ago, so manually set the order to confirmed).

I tried to direct access the url, which gives an empty page. In the code is the basic page without any content.

Webshop has been working fine for years, I do just another VM update and it stops working. There must be a reason.

Am I missing something obvious here?

Maybe a permission issue in the file or folders?

Take a look here see if it helps.

http://www.virtuemartrewardspoints.com/documentation/54-virtuemart-paypal-ipn-order-confirmation



Title: Re: Paypal IPN Notification
Post by: carsten888 on April 23, 2013, 18:50:29 PM
Yes that did help!
The screenshots are old, but 'Payment Data Transfer' to 'yes' did the trick.

I have no idea how this could have worked for years like this.

Thank you very much!
Title: Re: Paypal IPN Notification
Post by: jjk on April 23, 2013, 22:40:03 PM
Just for info - PayPal currently is changing a lot of their documentation and services and there still is plenty of old PayPal related stuff online.
The latest ones I know of are these:
https://www.x.com/sites/default/files/ipnguide.pdf
https://developer.paypal.com/webapps/developer/index