VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: gripped on May 22, 2014, 10:19:41 AM

Title: Paypal IPN bug
Post by: gripped on May 22, 2014, 10:19:41 AM
Since I updated my production site to 2.6.2 last night I noticed orders paid with paypal were not confirming.
Checking on Paypal the ipn's had been sent

From the error.log
[Thu May 22 01:26:26 2014] [error] [client 173.0.81.1] PHP Warning:  array_key_exists() expects parameter 2 to be array, null given in /var/www/ecigsoutlet.co.uk/htdocs/plugins/vmpayment/paypal/paypal.php on line 639
[Thu May 22 01:26:33 2014] [error] [client 146.90.107.111] PHP Notice:  Undefined variable: paypal_data in /var/www/ecigsoutlet.co.uk/htdocs/plugins/vmpayment/paypal/paypal.php on line 590, referer: https://www.paypal.com/uk/cgi-bin/webscr?cmd=_flow&SESSION=foo&dispatch=bar
[Thu May 22 01:26:33 2014] [error] [client 146.90.107.111] PHP Notice:  Trying to get property of non-object in /var/www/ecigsoutlet.co.uk/htdocs/plugins/vmpayment/paypal/paypal/tmpl/stdresponse.php on line 42, referer: https://www.paypal.com/uk/cgi-bin/webscr?cmd=_flow&SESSION=foo&dispatch=bar
[Thu May 22 01:26:33 2014] [error] [client 146.90.107.111] PHP Notice:  Trying to get property of non-object in /var/www/ecigsoutlet.co.uk/htdocs/plugins/vmpayment/paypal/paypal/tmpl/stdresponse.php on line 42, referer: https://www.paypal.com/uk/cgi-bin/webscr?cmd=_flow&SESSION=foo&dispatch=bar


I'm guessing this changed line (639) plugins/vmpayment/paypal/paypal.php might be at fault ? Returning a null array ?
$paypal_data = vRequest::get('post');

Anyway I have reverted the whole plugins/vmpayment/paypal folder back to the 2.6.0a code and its's working again now.

Paypal Standard
Title: Re: Paypal IPN bug
Post by: GJC Web Design on May 22, 2014, 11:12:45 AM
hmm - in vm2.6.2 there is public static function getPost( )  in administrator\components\com_virtuemart\helpers\vrequest.php

is that in your install?
Title: Re: Paypal IPN bug
Post by: gripped on May 22, 2014, 11:22:53 AM
It is


public static function getPost( ){
return  filter_var_array($_POST, FILTER_SANITIZE_STRING);
}
Title: Re: Paypal IPN bug
Post by: GJC Web Design on May 22, 2014, 12:32:10 PM
hmm - very odd - alatak ?
Title: Re: Paypal IPN bug
Post by: Milbo on May 22, 2014, 13:06:00 PM
There will be an update, today.
Title: Re: Paypal IPN bug
Post by: gripped on May 22, 2014, 14:58:23 PM
Cheers
Title: Re: Paypal IPN bug
Post by: e-trader on May 22, 2014, 18:57:16 PM
Will the update now work using the joomla update system? (the currently listed updates do not function)?
Title: Re: Paypal IPN bug
Post by: gripped on May 22, 2014, 19:37:07 PM
Live update has been removed because the joomla update is more reliable.
Title: Re: Paypal IPN bug
Post by: e-trader on May 22, 2014, 20:17:38 PM
Yes and ironically, the VM updates listed on the joomla update do not work.
Title: Re: Paypal IPN bug
Post by: Milbo on May 22, 2014, 20:29:11 PM
Today with the vm2.6.4?
Title: Re: Paypal IPN bug
Post by: patrik60 on May 23, 2014, 16:37:07 PM
Works fine with 2.6.4

Regards
Patrik
Title: Re: Paypal IPN bug
Post by: hegbi on May 25, 2014, 14:33:53 PM
Hi, still having this problem, updated all J2.5.20 / V2.6.4
error log
[25-May-2014 07:09:05 America/Chicago] PHP Notice:  Undefined variable: paypal_data in /***/plugins/vmpayment/paypal/paypal.php on line 590
[25-May-2014 07:09:05 America/Chicago] PHP Notice:  Trying to get property of non-object in /***/plugins/vmpayment/paypal/paypal/tmpl/stdresponse.php on line 42
[25-May-2014 07:09:05 America/Chicago] PHP Notice:  Trying to get property of non-object in /***/plugins/vmpayment/paypal/paypal/tmpl/stdresponse.php on line 42
IPN from PayPal is OK status 200 but not receiving anything (missing total value and currency)
What else to try?
Title: Re: Paypal IPN bug
Post by: alatak on May 26, 2014, 12:59:06 PM
Hello
Thank you for reporting thoses notices: i have fixed the code for this case.
You get them because you did not received an IPN.

If you were receiving an IPN before, and you updated to 2.6.4 both the component and aio, i do not see any reason why it should not work.
Can you activate the log option in the paypal configuration to check if there is any message logged that can help me to understand why you get this problem?
Title: Re: Paypal IPN bug
Post by: hegbi on May 27, 2014, 11:40:47 AM
Thank you for the answer.
First problem, the test site was under "Site Lock" (JShowroom). Reinstalled everything, pics changed from .png to .gif, unlocked the site, changed that both e-mail addresses are the same and now I am at least receiving e-mails, changed statuses and invoices! I think the main problem here was that I was too tired :)

Still shows those same PHP Notices in error.log and there is a total value & PayPal Transaction Id missing when redirected back to my site from PayPal. Everything else looks great in e-mails and on my web when you go back and check the order but when I check phpMyAdmin table *****_virtuemart_payment_plg_paypal, there are three lines for the same order (pending, confirmed by shoper, confirmed) but the last two are empty besides the order number in row "paypal_response_invoice".
Pls find logs attached.

Payment Name   PP PayPal account needed Sandbox (3)
Order Number   d602026
Total Amount   

Also, sometimes I receive e-mails like this:
An error with your payment paypal on your store *****.**. The details are logged in the file https://www.*****.**/administrator/index.php?option=com_virtuemart&view=log&task=edit&logfile=paypal.3.log.php
Title: Re: Paypal IPN bug
Post by: alatak on May 27, 2014, 11:43:16 AM
Hello
I cannot download your file. Please send it via PM.
Title: Re: Paypal IPN bug
Post by: hegbi on May 27, 2014, 11:47:02 AM
sent via e-mail, pls confirm
Title: Re: Paypal IPN bug
Post by: alatak on May 27, 2014, 11:47:52 AM
Hello
Yes , thank you. I received at the same time i was posting.
Title: Re: Paypal IPN bug
Post by: hegbi on May 29, 2014, 08:45:11 AM
Thank you so much Alatak for your help!! now when I use Payment type: Normal (not Shopping Cart setting in paypal plugin) everything works OK!
Thanks to alatak, we have realized that the problem with IPN in Shopping Cart setting was with apostrophe in a product title (like "Gateway Student's Book"). When there is no single quote in product title, everything works OK even in Shopping Cart setting.
Title: Re: Paypal IPN bug
Post by: alatak on May 29, 2014, 13:00:32 PM
Hello

The problem of the Quote in Product names is probably due to your server settings.
In 99% of the cases we do not have that problem.
Title: Re: Paypal IPN bug also in 2.6.6
Post by: YottoGlobal on July 30, 2014, 00:34:54 AM
Hi

I'm using 2.6.6 and I'm still getting the same error:

2014-07-29 21:15:39 ERROR Validación de IPN inválida: Array

Somebody can help?

Thanks,

Cheers,

Jorge
Title: Re: Paypal IPN bug
Post by: k0walsky on August 01, 2014, 12:24:47 PM
hello have same problem on vm 2.6.6  i see all order whit problem  come whit a quote (') inside address or name or any fild go pass to paypal

any solution?

tnks

MArco
Title: Re: Paypal IPN bug
Post by: britstak on August 01, 2014, 12:32:39 PM
I have been having a problem with the IPN paypal as well

this is the error:
ERROR validateIpnContent: VMPAYMENT_PAYPAL_ERROR_POSTING_IPN

Could this be related?

thanks
Title: Re: Paypal IPN bug
Post by: k0walsky on August 01, 2014, 12:37:55 PM
here attacched ipn log

maybe can be an help

2014-07-21 20:01:49 ERROR Convalida IPN non corretta: Array
(
[paypal_data] => Array
(
[mc_gross] => 251.13
[invoice] => 201407213030
[protection_eligibility] => Eligible
[address_status] => unconfirmed
[payer_id] => MN69CY3NCLZL2
[tax] => 0.00
[address_street] => VIA SAN FRANCESCO D'ASSISI, 19E
[payment_date] => 13:01:31 Jul 21, 2014 PDT
[payment_status] => Completed
[charset] => windows-1252
[address_zip] => 26100


---

2014-07-23 09:19:10 ERROR Convalida IPN non corretta: Array
(
[paypal_data] => Array
(
[mc_gross] => 70.20
[invoice] => 201407233049
[protection_eligibility] => Eligible
[address_status] => unconfirmed
[payer_id] => DNN6NFSKAVD3W
[tax] => 0.00
[address_street] => VIA PORTELLA DELL'ARENA 11 C.DA NISCIMA
[payment_date] => 02:18:55 Jul 23, 2014 PDT
[payment_status] => Completed
[charset] => windows-1252
[address_zip] => 93100

---

[payer_status] => verified
[business] => XXX#XXX.XXX
[address_country] => Italy
[address_city] => VARMO
[quantity] => 1
[verify_sign] => AT7SFZSrtUdu5b6hm-i80.i0oTEUApjrhKK-XtPXPlp9aUlpDZ.5xfND
[payer_email] => XXX#XXX.XXX
[txn_id] => 2X421065JH952473S
[payment_type] => instant
[last_name] => TOLO'
[address_state] => UD
[receiver_email] => XXX#XXX.XXX
[payment_fee] =>
[receiver_id] => KN6YT6HLA6H5U
[txn_type] => web_accept
[item_name] => Ordine Numero: 201407293096
[mc_currency] => EUR
Title: Re: Paypal IPN bug
Post by: alatak on August 01, 2014, 13:54:24 PM
Hello
http://forum.virtuemart.net/index.php?topic=125044.0