kulofang Posted January 31, 2013 Share Posted January 31, 2013 Muy buenas, tengo una tienda que solo me falta solucionar un problema que me ha surgido de ultima hora, y es que cuando se paga por paypal en el ultimo paso el de confirmar el pago (una vez logueado tu cuenta paypal) deberia de redirigir al pago completado pero me sale un error, error ocurred pero no pone ningun codigo de error para identificarlo ni habilitando el debug. Se que hay muchos post de este tipo de error con el modulo de paypal pero lo he probado y sigo igual. Adjunto la imagen del error y os pido por favor consejo para solucionarlo. Utilizo prestasshop 1.5.0.17 y el paypal 3.3. (He probado la última versión del modulo de paypal y ni siquiera me deja introducir los codigos de la api) Muchas gracias. Link to comment Share on other sites More sharing options...
kulofang Posted January 31, 2013 Author Share Posted January 31, 2013 Tengo una novedad, instalé el modulo 2.6 de paypal uno más antiguo y resulta que ahora solo me redirecciona al submit.php, una pagina en blanco con las palabras no currency. Solo tengo el euro puesto que puede ser? Link to comment Share on other sites More sharing options...
kulofang Posted January 31, 2013 Author Share Posted January 31, 2013 (edited) Me gustaria que cierren este post, ya esta solucionado. En el payment.php en el ultimo if, no entraba y era que no recojia bien los datos. Si alguien tiene algun problema similar que contacte conmigo que sin problemas se lo soluciono. Edited January 31, 2013 by kulofang (see edit history) Link to comment Share on other sites More sharing options...
cainfoxy Posted August 26, 2013 Share Posted August 26, 2013 Hola kulofang, a ver si hay suerte y me puedes ayudar. Tengo este problema desde hace unas 2 semanas, un cliente intentó pagar en mi tienda y no pudo, sale el "error ocurred" he intentado varias coas: Cambiar la url en SEO / URL que leí en algún post que si quitabas las www la cosa funcionaba. Pues a mi no. Desinstalar y volver a instalar el módulo, tampoco. Recolocar los datos de la API, tampoco. Contactar con mi hosting, paypal y AT&T, tampoco. Las versiones que tengo son: Prestashop 1.5.4.1 Paypal 3.5.8 Según la última llamada que hice a mi hosting, dicen que el problema puede venir de cuando paypal devuelve al usuario a mi tienda, este entra por un puerto seguro SSL (443) y al yo no tenerlo contratado debiera cambiarlo a un puerto normal como el 80, pero claro, no se donde he de hacer ese cambio, en el módulo de paypal no hay opción a cambiar ningún puerto. De todas formas, eso no me pasaba hace un par de semanas, y no he contratado nada nuevo ni quitado nada anterior asi que... Bueno, a ver si tu me puedes echar un cable. Gracias. Link to comment Share on other sites More sharing options...
Sergio Ruiz Posted August 27, 2013 Share Posted August 27, 2013 He encontrado esto: http://www.prestashop.com/forums/index.php?/topic/208395-paypal-error-occurred/page__view__findpost__p__1150997 We were also experiencing this problem on Prestashop 1.5.3 using the latest PayPal Module version directly from GIT (as of 2013-03-20) only on our production server. The Paypal express checkout would load with our cart contents, and allow us to login via paypal and pay for the order, however when returning to the store, an error would appear stating "ERROR OCCURRED:" with no log information. How this error comes up From debugging, our system was arriving at this error because /modules/paypal/express_checkout/payment.php was not "hitting" any of the conditions in the file, and instead exited via the else statement on line 344. This is normally used when Paypal has returned an error; $ppec->logs would contains the errors and these would be put out to the screen, however PayPal had no errors to report in our case. Looking at the code, we should have been taken in by the if condition on line 146 (see the comment preceding it), but we were not. Debugging the error We added the following two calls on line 100 to show us the values. This will firstly show us if PrestaShop is receiving the response from PayPal, and secondly what PrestaShop has stored for use in the conditions on line 146. var_dump($_REQUEST); var_dump($ppec); Simply compare the contents of ppec's "token" and "payer_id" fields to what's received in _REQUEST. If ppec has an empty token or payer_id, you've got the same bug I had, and please continue reading. If instead you find _REQUEST is empty or incomplete, check your Network tab and ensure you haven't been redirected and you've lost the query variables from Paypal along the way (htaccess rewriteRule being the usual culprit here). The PayPal module sends you to PayPal in the file /modules/paypal/express_checkout/process.php using the function redirectToAPI(). Inside this function, before the redirect to paypal, it calls _storeCookieInfo() which writes token and payer_id to the users cookie. The Bug Under some versions of PHP, PrestaShops method of saving the users cookie - which is to write the contents during the Cookie::_destructor - does not work. It flat out does not write the cookie reliably. I've documented this elsewhere in the past and it really should be addressed, but on later version of PHP (eg. 5.3) it's perfectly fine. Notice in _storeCookieInfo() and redirectToAPI() there are no calls to cookie->write(). This code relies entirely on the Cookie::__destructor method to save the cookie data. Our specific version is PHP 5.2.6 with Zend Engine 2.2.0 and ionCube 3.1.29 on a derivative of CentOS, in case you're wondering. The Fix Around line 420 of /modules/paypal/express_checkout/process.php, before the closing bracket of _storeCookieInfo(), add the following line: $this->context->cookie->write(); This causes the cookie to be written before you're sent to paypal. When you come back, you'll now have the correct data stored and PrestaShop will recognise the request. Further Reading If this didn't solve your problem, I feel sorry for you because this has taken me far too long to debug. If this did solve your problem, chances are you'll have additional issues with PrestaShop in its current configuration. Consider reading my other post on PrestaShop Cookies to address similar issues with Add to Cart and Login problems. Final Thoughts The PayPal modules validation should really be improved to catch this specific instance. The check that's there is obviously to verify that the inbound users payer_id and token match that of the outbound user, but there's no alert for the user if the stored payer_id or token are empty are invalid. Surely if you're inbound with a payer_id and token but ppec is empty, this means something has gone wrong and the user badly needs to know about it, because as far as PayPal is aware, that payment has gone through, but the order has been now been lost by PrestaShop. Link to comment Share on other sites More sharing options...
Recommended Posts