Post by tommix » Tue Aug 25, 2009 7:30 am

I trashed my old magento...and thought..welll it's opencart 1.3.2 already maybe paypal works as it should-well i have the same problem - paid but no order created nor client can see his orders..so the bug exists.

And Daniel -do what you want..hate me - but THIS IS BUG. EVERY EVERY POSSIBLE e-shops i've tried paypal works great even wordpress plugins with paypal support-works good..but somehow OpenCart doesn't

I did some tests and i found that it never passed this function:

Code: Select all

if (strcmp($response, 'VERIFIED') == 0) {
I did other test and got the $response and it is INVALID so that's why it never passes VERIFIED
REASONS FOR INVALID

- Make sure you are posting back ALL variables/values.

For PayPal to return VERIFIED, your IPN script needs to post back ALL the variables that were posted to it in the first place. In other words, if your script only needs to manipulate 1 or 2 variables, it is not enough to post back to PayPal only the variables/values your script is concerned with. Your script should post back EVERYTHING that was initially posted to it from PayPal. This is the only way PayPal will return VERIFIED

- Make sure you are not posting back to the wrong URL.
Last edited by tommix on Tue Aug 25, 2009 8:58 am, edited 3 times in total.

Active Member

Posts

Joined
Mon Apr 20, 2009 5:21 am

Post by Qphoria » Tue Aug 25, 2009 8:24 am

pm me your ftp and opencart admin details.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Daniel » Tue Aug 25, 2009 9:08 am

I have asked tommix many times for his FTP and admin details.

I suspect the problem is some security setting on your server.

all the virables that are posted to opencart are posted back.

$request = 'cmd=_notify-validate';

foreach ($this->request->post as $key => $value) {
$request .= '&' . $key . '=' . urlencode(stripslashes($value));
}

curl_setopt($ch, CURLOPT_POSTFIELDS, $request);

something is being blocked when paypal sends the request.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by tommix » Tue Aug 25, 2009 9:09 am

i gues it may be mod_deflate's fault..it compresses al data..so paypal says f** you if content is not = the same size...i'll try to disable it and then test.

but wait..no..i just used other scripts and paypal worked fine...so it can't be deflate's fault.

Daniel you NEVER asked for details. NEVER.

See how much i like your product? it drives me crazy but i'm still coming back to it :D

Active Member

Posts

Joined
Mon Apr 20, 2009 5:21 am

Post by Qphoria » Tue Aug 25, 2009 12:09 pm

I really don't know why, but as you noted in you PMs, Paypal keeps returning INVALID instead of VERIFIED which makes no sense. I even tried using my paypal account and it does the same. So maybe its something with your url or server or something. On my v132 with my paypal email it works fine and comes back VERIFIED everytime.

I don't know what else to tell you. Try googling "paypal returns INVALID" and see what you can find. This is certainly not typical behavior

Do you have another hosted site you can try it with (not a local site tho since IPN doesn't post back to "localhost")

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Daniel » Tue Aug 25, 2009 6:12 pm

do other carts work usign paypal?

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by tommix » Tue Aug 25, 2009 7:55 pm

Daniel wrote:do other carts work usign paypal?
Yes as i said amny times-they are working withut any problems. Paypal dev forum sais that it may happen because of encoding..maybe this will help you? Many people says it ok when u are from USA and i'm from Lithuania, so maybe somewhere is statically set my location and i need to set to to my country..i don't know i'm just guesing..

No Qphoria - i don't have other host. and i don't need it. My current host is one of the best in my country i got it very cheap with 40% discount.. The fact is that-other scripts works fine.
They works EVEN wih my htaccsess set to not allow ANYBODY to come to my site set only my ip and 127.0.0.1 and even then scripts works.

Active Member

Posts

Joined
Mon Apr 20, 2009 5:21 am

Post by Daniel » Tue Aug 25, 2009 8:48 pm

I think the problem is the encoding then.

opencart forces everyting to work with utf-8.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by tommix » Tue Aug 25, 2009 8:49 pm

I just now collected all $response and $request data... In response data also i found this: HTTP/1.1 301 Moved Permanently i gues it should not be there :)

I tried this time ONLY fsock function wanted to test maybe curl is bad but nope..fsock too..

I'll try to install other script and collect data too and will compare :)

Active Member

Posts

Joined
Mon Apr 20, 2009 5:21 am

Post by Daniel » Tue Aug 25, 2009 9:04 pm

this is down to how you have your server setup!

HTTP/1.1 301 Moved Permanently

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by Qphoria » Tue Aug 25, 2009 9:27 pm

I tried both curl and fsock on tommix's server yesterday too.
curl came back with "INVALID"
fsock came back empty.

Still I'm not quite sure where the problem is. I've not tested a live paypal purchase with v1.3.2 but I assume it must be working fine for most people.

1.3.0 (fsock) works perfectly (since i removed order id encryption)

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by tommix » Tue Aug 25, 2009 9:35 pm

Yes fsocks returns nothing about VERIFIED or INVALID... hmmm... i guest it will be something with callback url maybe? cause your paypal script is like the default so maybe something in variables is bad not script itself. And way some scripts uses stripsplashes some no, you use strlenght by decoding utf-8 and other scripts don't even they are ran in utf-8 site.

in fsock versio i'm getting this response: HTTP/1.1 301 Moved Permanently also.. how to know what url paypal try to open??? and got this?

if you guys don't know with bigger php knowledge than me..so i have no idea more than you :) I'm looking at other scripts papyal codes but..don't see something what can help me to fix it..

Active Member

Posts

Joined
Mon Apr 20, 2009 5:21 am

Post by Qphoria » Tue Aug 25, 2009 9:49 pm

best advice is to try it on another site with a different host if available. It could be something stupid like your url having "dashes" in it. Or something else on the webhost server that is modifying/corrupting data as it goes in/out.

I can try uploading 1.3.2 to my live server that i run 1.3.0 on to see if it works. If so then I'd have to assume its not an OpenCart problem.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by tommix » Tue Aug 25, 2009 10:13 pm

Qphoria wrote:best advice is to try it on another site with a different host if available. It could be something stupid like your url having "dashes" in it. Or something else on the webhost server that is modifying/corrupting data as it goes in/out.

I can try uploading 1.3.2 to my live server that i run 1.3.0 on to see if it works. If so then I'd have to assume its not an OpenCart problem.
Qphoria it opencart's fault. i MEAN NOT FULLY, but partially it is. cause other scripts in the same server, in the same domain and even in the same folder-works. But i need opencart... :) it''s light and easy to customize. and google love it even without not working seo urls :D

And i cant change server..it is best value server. i can change anyting in it..it's virtual server with root permissions so i can install anything i want..but if other scripts are working-then it means opencart can too, just need to find out who causes it...

I'm not ecspecting that you will wind, i'm just letting you know my progress on this...and as i saw not only me have this problem some people too had it i saw in forum.

Active Member

Posts

Joined
Mon Apr 20, 2009 5:21 am

Post by Qphoria » Tue Aug 25, 2009 10:16 pm

ok ok

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Tue Aug 25, 2009 10:31 pm

Well just to get it out of the way, I just tested v132 and it came back VERIFIED for me. Doesn't really help anyone I guess, but it at least works for some of us.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by tommix » Tue Aug 25, 2009 10:38 pm

I looked at Request data and i saw this: &payment_status=Completed&charset=windows-1252 what??? where is utf-8? why ?? hmm... As i understand this is paypal's charset not mine?

i even set this: $this->data['charset'] = 'utf-8'; and as you see it's anyway in $request charset=windows-1252

Qphoria i know that for others it works.. :)

Active Member

Posts

Joined
Mon Apr 20, 2009 5:21 am

Post by Daniel » Tue Aug 25, 2009 10:45 pm

what about the redirect you have on your site?

paypal might not allow redirects when posting data.

why would your opencart installation require a redirect? do others?

please post a link to your site!

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by tommix » Tue Aug 25, 2009 11:00 pm

what if i do not check response for verified but instead i will check $request for &payment_status=Completed ? or it's not 100% secure or stable??

Active Member

Posts

Joined
Mon Apr 20, 2009 5:21 am

Post by Qphoria » Tue Aug 25, 2009 11:31 pm

Its not 100% secure but it would still probably work. The chances of someone hacking it in are quite low.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 42 guests