Jump to content

Back Office not creating orders after successful payment


myquickjuice

Recommended Posts

My site is new and I'm testing functionality of placing orders before we launch and go live to "real" customers...


 


We have placed several test orders to ensure payment is working properly and orders on the backend would function as they should (send us a notification, adjust inventory, etc.)


 


The orders seem functional on the user side, payment goes through correctly from customer account to the merchant account, and I'm redirected back to my site with no errors (to Order History).. However, the back office does not create an order from the completed transaction - Had it not come from me, I wouldn't have even known about it.. I finally found it listed under "abandoned carts", but my inventory levels did not change, the transaction doesn't show up in my sales figures, and there is no order to show when I'm redirected back to the my orders page.. Had these been real orders, this would create big issues for me! Please help!


(more info in this thread: http://www.prestashop.com/forums/topic/335564-back-office-not-creating-orders/)


 


www.myquickjuice.com/shop


I'm using PrestaShop v.1.6.0.6 and PayPal USA mod v.1.3.4 with PayPal Payments Standard enabled... What am I missing? Is there a hook somewhere in the PayPal module that is not functioning correctly by not submitting the transaction to the proper place so an order gets created in my system? Or is this a problem in my back office?


 


 


update: I just enabled cash on delivery and placed another order choosing that option... the order was created in my back office with no problems... meaning, this is definitely an issue within the Payal module somewhere. It seems that my system is communicating with Paypal (item name and quantities from my order show up on the transaction when I view it from Paypal), but the Paypal module is not communicating with my system during the checkout/payment process in terms of transaction ID, amount, date, etc... Maybe this is why it's not creating the order on my back end?


post-793684-0-25885400-1402411805_thumb.jpg

post-793684-0-19329200-1402411810_thumb.jpg

Edited by myquickjuice (see edit history)
Link to comment
Share on other sites

Well, I've got the same problem.  The paypal module fails to create the orders in back office.  Additionally, I've noticed the order totals are off.  It appears PayPal is trying to charge tax on the shipping and then tax it again.

Link to comment
Share on other sites

I am getting similar issues when a voucher is used on check out. It brings the client to paypal, collects the money but doesn't follow back to the prestashop site to complete the transaction.

 

prestashop 1.5.3.1 and paypal 1.34

Link to comment
Share on other sites

Hi All,

 

I have implemented the paypal module and it works fine for me at last. You can also use the Express Checkout method of Paypal and it also generate order confirmation page and display order in backoffice as well.

 

You can download it from

http://addons.prestashop.com/en/payments-gateways-prestashop-modules/1748-paypal.html

 

It is free.

I don't really understand what you're trying to say.  Are you saying that you switched to using the Europe version of PayPal and it solved your problem or that you removed and reinstalled the PayPal module or were you simply not aware that you needed the PayPal module to use the service and that was your particular problem in the first place?  Just curious.  If you actually found a solution I would love to hear it as the problem, as far as I can tell, is still ongoing.

Link to comment
Share on other sites

I'm experiencing the same problem.

 

At first I was getting a 404 error when returning from Paypal, but was able to solve that by editing paypalusa.php. However, once that was done, the order still wasn't going through correctly. 

 

A note on what others have said: redirecting to order history after coming back from PayPal is NOT the correct behavior. You should be redirected to a page with a URL something like this: www.mystore.com/order-confirmation?id_cart=1270&key=a822f32a20b031be11605691e9353686&id_module=122, which should show an order confirmation message.

 

I noticed that PayPal actually *is* redirecting back to this URL, but when PS attempts to load this page, it redirects to order history instead. I'm guessing that it's doing this because it's trying to load a confirmation for an order that was never created. I guess PS's default behavior is to go to the order history page when a user tries to access an order confirmation page for a non-existent order.

 

So far, I have tried the following:

 

1) Disabling taxes as mentioned here: http://www.prestashop.com/forums/topic/328666-how-to-fix-paypal-usa-133-prestashop-1606-getting-404s-not-fulfilling-orders-on-return/. Unfortunately, taxation on shipping was not my problem. Order totals between PP and PS match up, and even with taxes disabled and free shipping, orders are still not created.

 

2) Using the PayPal Europe module instead of PayPal USA. Some people said this worked for them, but PayPal Europe 3.6.8 sent me to a blank page and 3.7.1 sent me to a page that said "Fatal error". In both cases, orders were not created.

 

3) Setting up PayPal IPN as suggested here: http://www.prestashop.com/forums/topic/282164-paypal-payment-but-no-orders/. This was a suggestion for PS 1.5.6.0  and PP USA 1.2.6, but I tried it anyway, since nothing else worked. Unfortunately, this didn't either.

 

4) Changing permissions to 755 (folders) and 644 (files). Didn't change anything.

 

5) Setting up Auto Return in my PayPal account. it did automatically redirect back to the cart (instead of needing to click on the link to go back), but orders were still not created in PS.

Edited by moomal (see edit history)
Link to comment
Share on other sites

Ok, well at least for my problem, I finally got this solved.

 

Here was the issue:

 

I am using Website Payments Standard, which apparently *does* require IPN to be set up. (You can do that in your PayPal account, under Profile > Instant Payment Notification preferences.) The comments in standard.tpl say to use the URL www.mystore.com/modules/paypalusa/controllers/front/validation.php?pps=1 (changing www.mystore.com to your domain), but when I tested this using the IPN simulator, it was returning a server 500 error.

 

I dug a little further into the code and found that validation.php had no access to PrestaShop - it was operating like a standalone script, so when it was calling PS classes and functions, it would just fail since it didn't know how to find them.

 

Similarly, the "$this->paypal_usa = new PayPalUSA();" call was not able to get access to the PayPal USA module.

 

I also found that the "extends ModuleFrontController" was causing problems, since the class PayPalUSAValidationModuleFrontController wasn't sending a module name, which was causing problem when parent::initContent(); was called (ModuleFrontController.php was eventually calling to Module.php, which required a module name in order to work). Removing it didn't seem to cause any problems.

 

Finally, the class on its own wasn't doing anything, so I needed to manually call initContent to get the whole thing running.

 

This is almost certainly a collection of hacks, since I'm really not much of a PHP programmer. There's probably a much better, correct way to fix the problem, but this works. That's good enough for me, until the module is fixed by PS.

 

 

Here is a summary of the changes to modules/paypalusa/controllers/front/validation.php:

 

 

On line 31, change

class PayPalUSAValidationModuleFrontController extends ModuleFrontController

to

class PayPalUSAValidation

Then delete line 41:

parent::initContent();

This removes the call to ModuleFrontController::initContent().

 

 

Next, on line 30, just below the comments and just above

class PayPalUSAValidation

insert these two lines:

require_once(dirname(__FILE__).'/../../../../config/config.inc.php');
require_once(dirname(__FILE__).'/../../paypalusa.php');

This gives the script access to PS and the PayPal module.

 

 

Then finally, at the very end of the file, insert:

$validate = new PayPalUSAValidation;
$validate->initContent();

This will call PayPalUSAValidation::initContent(), so that the script runs and creates the order.

Link to comment
Share on other sites

@bellini13 - Hmm, you are correct - I turned off IPN in my PayPal account and it still worked.

 

@myquickjuice - As for why these changes didn't solve the problem, I really can't say. This is what worked for *me*, but your problems could stem from very different sources.

Link to comment
Share on other sites

@myquickjuice - As for why these changes didn't solve the problem, I really can't say. This is what worked for *me*, but your problems could stem from very different sources.

 

This is correct.  There are various issues that will result in no order being created.  A few examples are

1) The customers paypal address not having states, but Prestashop being configured to require a State

2) The customers paypal profile does not have a phone number, but Prestashop by default requires all addresses to have a phone number

3) The module has a defective notify URL depending on the PS version

4) The prestashop product name has characters that Paypal do not accept

5) The customers address used in Prestashop is not a valid address, and Paypal rejects it

 

There are likely numerous other issues that would cause this, and they all result in the same thing, an order not being created.  So you really need to look into each issue individually and determine what is causing the problem.  This requires lots of testing and code debugging and is not trivial

  • Like 1
Link to comment
Share on other sites

thank you for outlining these possibilities.. I don't think any of those are causing the issue, but I do not know for sure.. I have zero experience in testing/debugging so I have no idea what to do in order to find out the root cause.. do you by chance have any useful info that could lead me in the right direction?

Link to comment
Share on other sites

found a few issues that seemed to resolve the problem (for now *fingers crossed*) 

the shipping methods all had tax enabled... switched each method to "No Tax" and that seemed to fix it

then I began having the problem again... turns out it also doesn't work for anyone allocated to a discount group.

I removed all customers from any discount groups and their orders began working again.

which is good, because I can once again take orders... but bad also, because my customers are unhappy that they are no longer receiving discounts... if anyone knows a work around to be able to allow group discounts, that would be great!

other than that, the problem seems to be solved for now... after many code changes and two weeks worth of lost sales (sigh)

  • Like 1
Link to comment
Share on other sites

if anyone knows a work around to be able to allow group discounts, that would be great!

other than that, the problem seems to be solved for now... after many code changes and two weeks worth of lost sales (sigh)

 

perhaps you should open a bug report in the bug tracker so Prestashop is made aware of the issue and they should address it.  Be sure to include exact details on how to reproduce your issue or they will reject it

 

http://forge.prestashop.com/secure/Dashboard.jspa

Link to comment
Share on other sites

thanks @bellini, I will do that...

 

one last problem related to the subject..

for some reason it seems that the defualt behavior upon return from paypal's confirmation page is to redirect to my site's order-history page.. I've changed the redirect settings in paypal, but still it goes to order-history if the redirect is set to anything other than order-confirmation.

However, when I set the redirect to order-confirmation, my site produces an error message (incorrectly, I believe.. the order goes through and so does the payment..) it should show the details of the transaction, not an error..

I've tried to manipulate the order-confirmation.tpl file by deleting {include file="tpl_dir./errors.tpl"} from line 33, but I still get the same error message.

 

any tips?

 

http://myquickjuice.com/shop/order-confirmation?id_cart=38&id_module=71&key=f9c8366f84679c0ac9ae5c7e2959ce39

 

post-793684-0-10987000-1403791182_thumb.png

Edited by myquickjuice (see edit history)
Link to comment
Share on other sites

It should return to order-confirmation, so that the order reference is displayed, and any modules hooking order confirmation are executed. 

 

what you need to determine or provide is the error that is produced. 

 

Note: When there is an issue creating an order, Prestashop redirects the customer to order history.  To be blunt, it does this because the software is too stupid to do anything better.

Link to comment
Share on other sites

found a few issues that seemed to resolve the problem (for now *fingers crossed*) 

the shipping methods all had tax enabled... switched each method to "No Tax" and that seemed to fix it

then I began having the problem again... turns out it also doesn't work for anyone allocated to a discount group.

I removed all customers from any discount groups and their orders began working again.

which is good, because I can once again take orders... but bad also, because my customers are unhappy that they are no longer receiving discounts... if anyone knows a work around to be able to allow group discounts, that would be great!

other than that, the problem seems to be solved for now... after many code changes and two weeks worth of lost sales (sigh)

This^^. Have made multiple live Paypal transactions until one of my Wholesale(Discount Group=Wholesale) clients tried to place an order.

Attached uploads disappeared with the order. Funds where received via Paypal minus the shipping.

Link to comment
Share on other sites

  • 3 weeks later...

Still not getting orders from my wholesale group customers when they pay with paypal.

 

Is there any way to disable pay-pal for a group?

 

I see some other posts about this but in other languages...how can I tell if anyone is even working on it?

Link to comment
Share on other sites

  • 4 weeks later...

I started also experiencing this two days ago. PP funds come through, but no PS order created and the cart remains.

At first it appeared to coincide with upgrading from the previous ver of the PayPal Module to v1.3.7, so I reverted back to the previous version from a backup, but the problem persisted. I am using only PayPal Standard. The module isn't very configurable aside picking your PP service. 

 

@bellini13, I am positive it's not of the 5 things you've listed because I'm using my own customer account and PP account (different from my PS PP account).

  1. My complete shipping information (incl state) is in my PS profile as well as my PP shipping info
  2. No phone numbers required in my PS config
  3. How can I confirm the notify URL? I'm on PS 1.6.0.8
  4. No special characters in our product names. This is happening for every product I've tried.
  5. Address is surely valid

The bizarre thing is that we've had 20+ PP orders in the last 60 days for which ALL orders were created. In fact prior to two days ago I never once received PP payment without a PS order. Note my Auth.net payments all generate orders.

There has to be greater insight into this issue. It's apparently affecting many installations.

Link to comment
Share on other sites

A few more things:

  • I enabled debug in defines.inc.php, but nothing appears in my Apache / PHP log nor the screen
  • After successful PP transaction there's no redirection. It just stays at the PayPal screen, "Thanks for your order"

This is a serious disruption, really need some help here. Thanks!

Link to comment
Share on other sites

I started also experiencing this two days ago. PP funds come through, but no PS order created and the cart remains.

At first it appeared to coincide with upgrading from the previous ver of the PayPal Module to v1.3.7, so I reverted back to the previous version from a backup, but the problem persisted. I am using only PayPal Standard. The module isn't very configurable aside picking your PP service. 

 

So it sounds like everything is working with the exception of processing the IPN.  For PS 1.6 and the USA module, the IPN URL should be along the lines of ...

http://domain.com/modules/paypalusa/validation?pps=1

There are 2 important URLS, the IPN URL (aka notification) and the return URL.  During checkout, before you click the Paypal image, you can perform a view source of the browser and search for "notify_url".  You will see both the "notify_url" and the "return" URL.

 

A few more things:

  • I enabled debug in defines.inc.php, but nothing appears in my Apache / PHP log nor the screen
  • After successful PP transaction there's no redirection. It just stays at the PayPal screen, "Thanks for your order"

This is a serious disruption, really need some help here. Thanks!

 

Since the issue is with the IPN, which is a server to server transaction, enabling debug will have no effect, since there is not a browser window involved. 

 

Auto redirection is a setting in your Paypal profile.  If auto redirect is off, then the customer has to click on a link to return to your site.  But that has no effect on the IPN being sent. 

 

So a few things for you to do

1) confirm what the URL's are in the browser source code

2) ensure you are not testing in maintenance mode, that will prevent the IPN from being received

3) check your access logs and confirm that you see the notify URL in the logs.  If you do not see it, then this is either because the module is using the wrong one, or because Paypal is just not sending it.  Paypal will disable the IPN after a few failed attempts.  I suspect neither of these are the problem

4) If you do see the URL in the logs, then we know Paypal is sending the IPN.  Then just confirm what the status code is in the log.  200 would be a good status, anything else (like 500, 404, 503 etc..) would be bad

 

Do those things and then provide an update, and we can go from there.

Link to comment
Share on other sites

bellini13, thank you so much for this!

It helped me get on the right track. Yes, it appears to me that indeed everything is working except for the IPN. Viewing the source code revealed that "notify_url" is actually null! (""). I didn't bother checking access logs since the IPN URL isn't even being submitted to PP. Any ideas on how to fix the IPN URL? I even deleted and reinstalled the PP Module to make sure all the files are original and valid, but same result. 

My dev shop is dev.playdateshoppe.com

Here's the PayPal form source:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
	<p class="payment_module">
		<input type="hidden" name="cmd" value="_cart" />
		<input type="hidden" name="upload" value="1" />
		<input type="hidden" name="charset" value="utf8" />
		<input type="hidden" name="business" value="[email protected]" />
		<input type="hidden" name="currency_code" value="USD" />
		<input type="hidden" name="custom" value="212;1" />
		<input type="hidden" name="amount" value="0.2" />
		<input type="hidden" name="first_name" value="Bob" />
		<input type="hidden" name="last_name" value="Jones" />
		<input type="hidden" name="address1" value="112 Kennedy lane" />
				<input type="hidden" name="city" value="San Diego" />
					<input type="hidden" name="state" value="CA" />
				<input type="hidden" name="zip" value="90210" />
		<input type="hidden" name="email" value="[email protected]" />
				<input type="hidden" name="night_phone_b" value="8105310255" />
				<input type="hidden" name="address_override" value="1" />
		
					
			<input type="hidden" name="item_name_1" value="Your order" />
			<input type="hidden" name="amount_1" value="0.2" />
				
		<input type="hidden" name="tax_cart" value="0.01" />
		
		<input type="hidden" name="notify_url" value="" />
		<input type="hidden" name="return" value="http://dev.playdateshoppe.com/order-confirmation?id_cart=212&key=0c8985e832a4eef36030f1bcd2bec22b&id_module=92" />
		<input type="hidden" name="cancel_return" value="http://dev.playdateshoppe.com/order" />
		<input type="hidden" name="no_shipping" value="1" />
		<input type="hidden" name="bn" value="PrestashopUS_Cart" />
		<input id="paypal-standard-btn" type="image" name="submit" src="https://www.paypalobjects.com/en_US/i/bnr/horizontal_solution_PPeCheck.gif" alt="" style="vertical-align: middle; margin-right: 10px;" /> Pay with PayPal
	</p>

Thanks so much!

Link to comment
Share on other sites

well, that is interesting.  is this module v1.3.7?

 

PS did make a change here to attempt to make it compatible with PS v1.4, but apparently they broke PS v1.5 and v1.6 doing this... "testing" for the win!

 

so, open paypalusa.php (v1.3.7) and locate the function hookPayment, in there you will see the following line

'paypal_usa_notify_url' => $this->getModuleLink('paypalusa', 'validation', array('pps' => 1), Configuration::get('PS_SSL_ENABLED')),

change it to this...

'paypal_usa_notify_url' => $this->context->link->getModuleLink('paypalusa', 'validation', array('pps' => 1), Configuration::get('PS_SSL_ENABLED')),

Then try to view the browser source again and see if there is a value.  I would expect to see something along the lines of

http://dev.playdateshoppe.com/module/paypalusa/validation?pps=1

Note: only do this if you are using PS v1.5 or PS v1.6.  It will not work in PS v1.4

  • Like 2
Link to comment
Share on other sites

Hi again, 

 

so I tried the fix above, and the back office now registers an order after payment, so that's great!

 

However, after completing the payment I get redirected to the order history page - (which is an improvement as it used to get me to a 404 page). It still isn't the order confirmation page as it should. Any ideas on where to go from there?

 

I also notice that the products that were just purchased still show in the cart, even though the order has been placed and registered.

 

 

 

Thanks!

 

A

Edited by anncrow (see edit history)
Link to comment
Share on other sites

bellini13, your code worked perfectly and the "notify_url" is now https://dev.playdateshoppe.com/module/paypalusa/validation?pps=1 but sill no order :/

Latest Paypal HTML:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
	<p class="payment_module">
		<input type="hidden" name="cmd" value="_cart" />
		<input type="hidden" name="upload" value="1" />
		<input type="hidden" name="charset" value="utf8" />
		<input type="hidden" name="business" value="[email protected]" />
		<input type="hidden" name="currency_code" value="USD" />
		<input type="hidden" name="custom" value="212;1" />
		<input type="hidden" name="amount" value="0.2" />
		<input type="hidden" name="first_name" value="Bob" />
		<input type="hidden" name="last_name" value="Jones" />
		<input type="hidden" name="address1" value="112 Kennedy lane" />
				<input type="hidden" name="city" value="San Diego" />
					<input type="hidden" name="state" value="CA" />
				<input type="hidden" name="zip" value="90210" />
		<input type="hidden" name="email" value="[email protected]" />
				<input type="hidden" name="night_phone_b" value="8105310255" />
				<input type="hidden" name="address_override" value="1" />
		
					
			<input type="hidden" name="item_name_1" value="Your order" />
			<input type="hidden" name="amount_1" value="0.2" />
				
		<input type="hidden" name="tax_cart" value="0.01" />
		
		<input type="hidden" name="notify_url" value="https://dev.playdateshoppe.com/module/paypalusa/validation?pps=1" />
		<input type="hidden" name="return" value="http://dev.playdateshoppe.com/order-confirmation?id_cart=212&key=0c8985e832a4eef36030f1bcd2bec22b&id_module=92" />
		<input type="hidden" name="cancel_return" value="http://dev.playdateshoppe.com/order" />
		<input type="hidden" name="no_shipping" value="1" />
		<input type="hidden" name="bn" value="PrestashopUS_Cart" />
		<input id="paypal-standard-btn" type="image" name="submit" src="https://www.paypalobjects.com/en_US/i/bnr/horizontal_solution_PPeCheck.gif" alt="" style="vertical-align: middle; margin-right: 10px;" /> Pay with PayPal
	</p>
	

I made a screenshot of the exact flow that's happening (see attachment).

anncrow, do you have any settings enabled in PP to send IPN or Returns? I didn't have any of these enabled before. We're closer!

post-801221-0-95931300-1408041092_thumb.gif

  • Like 1
Link to comment
Share on other sites

I am having this same issue. I am running prestashop verson 1.6 and paypal 1.3.7 payments standard. It no longer creates the order in the back office. I receive the payment in Paypal, but no order is created in the back office, and the customer is redirected to an empty "order history" with the order still in the cart.

 

I applied bellini13's fix and am still having the issue. I also have configured the IPN, and am just not sure what else I can do? What else am I missing? This is driving me insane!

 

Link to comment
Share on other sites

Hi AbdulK,

 

I experience the exact same flow as you.

As for IPN and returns, I honestly don't know where that setting is? I do receive notifications of payments, and I am able to process refunds, but I'm not sure that is what you mean. 

 

Thanks for your help, it's very appreciated!

 

A

Link to comment
Share on other sites

Also, I have just confirmed from my Apache access logs that there is no access to "/module/paypalusa/validation?pps=1" after the order, although the "notify_url" value is now "https://dev.playdateshoppe.com/module/paypalusa/validation?pps=1"

The only access to it was when I navigated there myself to check the output.

So, PayPal is NOT pinging back my site after an order.. What can I try next?

By the way, thank you for all your time and effort. I sincerely appreciate it! 

  • Like 1
Link to comment
Share on other sites

I was able to have the order created, it shows up in back office and sends customer to order confirmation. But, there is an error:

 

 

Unfortunately, an error occurred during the transaction.

Please double-check your credit card details and try again. If you need further assistance, feel free to contact us anytime.

(Your Order's Reference: HNGZMTUFA)

 

Though, it shows in the customers account that the order was placed and is valid, and I am showing it in the back office. I deleted the friendly URL for "order-confirmation" that I had created, and then put "http://www.yourdomain.com/order-confirmation.php?id_cart=" in the Return URL setting with Paypal.

 

The customer gets the email from my back office and from Paypal confirming the order.

Link to comment
Share on other sites

I was able to have the order created, it shows up in back office and sends customer to order confirmation. But, there is an error:

 

 

Unfortunately, an error occurred during the transaction.

 

Please double-check your credit card details and try again. If you need further assistance, feel free to contact us anytime.

 

(Your Order's Reference: HNGZMTUFA)

 

Though, it shows in the customers account that the order was placed and is valid, and I am showing it in the back office. I deleted the friendly URL for "order-confirmation" that I had created, and then put "http://www.yourdomain.com/order-confirmation.php?id_cart=" in the Return URL setting with Paypal.

 

The customer gets the email from my back office and from Paypal confirming the order.

 

 

I have seemed to completely fix this issue; I can checkout and return to the website with the correct confirmation page. Order shows up in back office and in the customer account. Customer receives confirmation from my website and from Paypal.

 

I applied this fix from bellini13:

 

well, that is interesting.  is this module v1.3.7?

 

PS did make a change here to attempt to make it compatible with PS v1.4, but apparently they broke PS v1.5 and v1.6 doing this... "testing" for the win!

 

so, open paypalusa.php (v1.3.7) and locate the function hookPayment, in there you will see the following line

'paypal_usa_notify_url' => $this->getModuleLink('paypalusa', 'validation', array('pps' => 1), Configuration::get('PS_SSL_ENABLED')),

change it to this...

'paypal_usa_notify_url' => $this->context->link->getModuleLink('paypalusa', 'validation', array('pps' => 1), Configuration::get('PS_SSL_ENABLED')),

Then try to view the browser source again and see if there is a value.  I would expect to see something along the lines of

http://dev.playdateshoppe.com/module/paypalusa/validation?pps=1

Note: only do this if you are using PS v1.5 or PS v1.6.  It will not work in PS v1.4

 

Then check your settings in Paypal:

 

My IPN settings in Paypal : http://yourdomain.com/modules/paypalusa/controllers/front/validation.php?pps=1

 

Under "website preferences" in Paypal I have Auto Return set to on, and the Return URL set to: "http://www.yourdomain.com/order-confirmation.php?id_cart="

 

Payment Data Transfer option is set to off.

 

Make sure you do not have a url rewrite or "friendly url" for the order confirmation page.

Link to comment
Share on other sites

After applying the above changes in my Paypal settings, the order does not log anymore in the back office. :/ It does however redirect to the site, but it is STILL to the order history page.

 

So, when my IPN settings were just disabled, it communicated fine with the back office, now that it's enabled, it doesn't. I'm lost. 

 

EDIT: I disabled the IPN messages again - and it still doesn't log orders in the back office. (It did before I apllied those changes...)

 

A

Edited by anncrow (see edit history)
Link to comment
Share on other sites

So I confirmed that the notify_url and return were correctly set, but still, it does not log an order in the back office, redirects to the order history page (where the order just placed is not logged) and still shows a full cart.

 

I am so lost!

 

 

A

Link to comment
Share on other sites

I'm trying to understand how come the order WERE LOGGED after I applied Bellini's fix, but after changing a few Paypal settings, and reverting those changes, oders do not log anymore. This is actually worse than my first situation, as the customer is brought back to a order history page were the order they just paid for is not logged... It's maddening.

 

A

Edited by anncrow (see edit history)
Link to comment
Share on other sites

Hey guys,

I meant to post this update some time back.  We originally encountered this error after switching from the PayPal payment module to the PayPal US & Canada version of the module.  The original module had stopped working for some reason and the US&Canada version was exhibiting the behavior described in this thread.  We uninstalled and deleted both modules, reinstalled the regular PayPal module and then called PayPal to verify the settings.  This solved our problem.  I hope this helps someone.  I'm not an engineer so we didn't do any hacking, just troubleshooting.

Good luck.

Link to comment
Share on other sites

You should leave IPN disabled in your Paypal profile, it will not help you.  The only reason to enable it is to view your IPN history, but then remember to disable it.  This is just a design flaw with Paypal, you should be able to view the IPN history without have to enable IPNs.  This is because IPN's can still be sent (even though disabled, yes I know that sounds odd).  But the payment module instructs Paypal to send the IPN, and so Paypal ignores your profile setting, and sends it.

 

So if you have a valid notify url defined now after applying my patch, but still not receiving the IPN (as confirmed by your access logs), then this may mean 1 of 2 things

1) You are testing in maintenance mode.  You cannot do this, the IPN will be rejected by your store (since the store is 'offline')

2) Paypal has disabled sending you the IPN, because it has likely attempted too many times and failed.  This will auto correct itself over time, and there is nothing you can do but wait.  Again, you need to confirm this by checking your access logs.

Link to comment
Share on other sites

Bellini13, after reapplying your patch on a clean install of the Paypal module, I'm happy to report that the orders are registering again with through the back office. Phew!

 

Now, I still get redirected to the Order History page after payment, but this is the best result I've got so I'm wary of messing with it again. 

 

I left IPN disabled in my Paypal settings. I'm definitely not in maintenance mode. 

 

 

Thanks for all your help,

 

 

Ann

Link to comment
Share on other sites

ok, so now this may just be a timing issue.  You may be returning to your site "to fast".  Do another test, but this time, before you click on the return link from paypal, first go to your back office and refresh the order page.  Wait until you see the order created (IPN received).  Then click on the return link and see if anything changes.

 

So it should be something like this

1) Checkout and click on paypal payment method

2) complete payment on paypal website, but do not click the return link

3) go to your back office and refresh orders page to confirm an order is created.  Once the order is created, this means the IPN was received and processed.  Make sure the order status is Payment Accepted

4) Now click on the return link and see if you receive the order confirmation page.  Also confirm that the cart is now empty.

Link to comment
Share on other sites

I'm on the phone with PayPal now.. I got my IPN history to show up in my PP account, bellini13 was 100% right about needing to put an IPN URL in PP in order to enable IPN history although if "notify_url" is specified it overrides that setting (ref: https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNSetup/)

Since bellini13's fix, PP has been sending me an IPN and according to the IPN history, successfully. However, I'm positive these haven't been received by my server per my Apache access logs and lack of orders in PS. I'll report my findings after my call.

Link to comment
Share on other sites

Well... it's finally fixed on my production site, although not working on my dev site, but I don't care about that because I wipe it out every few days anyway.

So it turned out that my one and only problem was the null "notify_url", which bellini13's code surely fixed (thank you!!!). I was mistaken that https://dev.playdateshoppe.com/module/paypalusa/validation?pps=1 was not in my access log because I neglected to look in the SSL-specific log. Checking that one revealed that the IPNs were coming through since bellini13's fix.

So the only mystery is why does it not work on my dev server? Well, who cares.. I'll be deleting it soon anyhow!

Thanks to all for helping me through this seemingly hopeless issue.

 anncrow, I believe your current functionality is actually the expected behavior. I don't think PP forwards you anywhere after a payment until you click the "Return to..." link. And if the IPN was successful, then the return URL will have your order information in it directing the buyer to that order's confirmation, otherwise to the general order history page. I'm quite sure this is how it works and what bellini13 was referring to when he called it a "timing issue".

Edited by abdulk (see edit history)
Link to comment
Share on other sites

I'm kind of a PHP newb,,,,
BUT..
it looks like the "getModuleLink" code is incorrect, at least for the version of PS (1.6.0.9) and PayPal (1.3.7) module that I'm using.
 
This is what it looks like:
public function getModuleLink($module, $controller = 'default', array $params = array(), $ssl = null)
{
if (version_compare(_PS_VERSION_, '1.5', '<'))
$link = Tools::getShopDomainSsl(true)._MODULE_DIR_.$module.'/'.$controller.'?'.http_build_query($params);
else
$link = $this->context->link->getModuleLink($module, $controller, $params, $ssl);
}

But shouldn't this function return a value, like this?

public function getModuleLink($module, $controller = 'default', array $params = array(), $ssl = null)
{
if (version_compare(_PS_VERSION_, '1.5', '<'))
$link = Tools::getShopDomainSsl(true)._MODULE_DIR_.$module.'/'.$controller.'?'.http_build_query($params);
else
$link = $this->context->link->getModuleLink($module, $controller, $params, $ssl);

return $link;
}

Especially since the function is being called as an argument in other function calls, and expecting a return value.

 

This fixed the issue I had with orders not being created.

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

Help, I have the same problem (cart doesn't become an order) but my customers are charging twice (I think they click again on the paypal button because they don't see the order).

 

Despite reading all Bellini's comments I can't find what Anncrow is talking about :

 

Bellini13, after reapplying your patch on a clean install of the Paypal module, I'm happy to report that the orders are registering again with through the back office. Phew!

 

 

I'm selling downloadable products and it's since I available automatic sending after payment that this problem appeared.

 

I must specify :

- I'm not native english,

- I'm newbie in Prestashop

so I need a step by step help... please :rolleyes:

 

I tried a view source (last step of the cart, before clicking on the PayPal button) but I have no "notify_url" neither "return" url...  Will I live, doctor?

 

Prestashop 1.5.6.2

PayPal 3.7.2 (Europe addon)

Link to comment
Share on other sites

I had search for days a solution in the french forum, and posted a topic in it. But the french forum isn't very active...  :wacko:

 

So when I came in the english forum, I first post a new topic... and after I have seen this one

I'm sorry for that, I did the wrong way.

 

But I still have my problem... 

Link to comment
Share on other sites

some advice

 

do not post in old posts with 'similar' issue.

 

to get best community review, open a new topic for your question/issue.

 

 

I had search for days a solution in the french forum, and posted a topic in it. But the french forum isn't very active...  :wacko:

 

So when I came in the english forum, I first post a new topic... and after I have seen this one

I'm sorry for that, I did the wrong way.

 

But I still have my problem... 

 

post new topic, please read advise here...and follow :)

Link to comment
Share on other sites

  • 5 weeks later...
  • 3 months later...

Hi Bellini13,

 

Im wondering if i should try your fix mentioned in a previous post or i might end up doing more harm than good? (probably not possible though) 

 

Im on prestashop 1.6.0.11

Using paypal version latest europe, 3.8.1

 

Is it worth trying the code change you mentioned based on my above versions?

 

my issue is orders not showing again in backoffice after customer successfully completes a paypal payment they go to blank screen. 

 

Ive noticed our paypal module is no longer hooked into anywhere when i look at the live edit screen, its also NOT hooked in the the 'displaypaymentreturn' hook. 

 

When we did a fresh install of prestashop the paypal problem was fixed, i noticed on the LIVE EDIT screen after the fresh install that paypal is hooked into a lot of different locations. 

 

Then our developer makes some front end changes, mostly to the header sections, and its as though some of the hooks dissapear. 

Link to comment
Share on other sites

Hi Bellini13,

 

Im wondering if i should try your fix mentioned in a previous post or i might end up doing more harm than good? (probably not possible though) 

 

Im on prestashop 1.6.0.11

Using paypal version latest europe, 3.8.1

 

Is it worth trying the code change you mentioned based on my above versions?

 

my issue is orders not showing again in backoffice after customer successfully completes a paypal payment they go to blank screen. 

 

Ive noticed our paypal module is no longer hooked into anywhere when i look at the live edit screen, its also NOT hooked in the the 'displaypaymentreturn' hook. 

 

When we did a fresh install of prestashop the paypal problem was fixed, i noticed on the LIVE EDIT screen after the fresh install that paypal is hooked into a lot of different locations. 

 

Then our developer makes some front end changes, mostly to the header sections, and its as though some of the hooks dissapear. 

 

Same problem here. If you set TRUE to _PS_MODE_DEV_

the blank screen returns this errors:

 

IF EXPRESS CHECKOUT DISABLED:

Notice: Undefined index: PAYMENTREQUEST_0_SHIPPINGAMT in /var/www/vhosts/donpet.es/httpdocs/modules/paypal/paypal_orders.php on line 70 Fatal error: Uncaught exception 'PrestaShopException' with message 'Property Order->payment is empty' in /var/www/vhosts/donpet.es/httpdocs/classes/ObjectModel.php:866 Stack trace: #0 /var/www/vhosts/donpet.es/httpdocs/classes/ObjectModel.php(272): ObjectModelCore->validateFields() #1 /var/www/vhosts/donpet.es/httpdocs/classes/order/Order.php(299): ObjectModelCore->getFields() #2 /var/www/vhosts/donpet.es/httpdocs/override/classes/order/Order.php(10): OrderCore->getFields() #3 /var/www/vhosts/donpet.es/httpdocs/classes/ObjectModel.php(480): Order->getFields() #4 /var/www/vhosts/donpet.es/httpdocs/classes/order/Order.php(304): ObjectModelCore->add(true, true) #5 /var/www/vhosts/donpet.es/httpdocs/classes/PaymentModule.php(335): OrderCore->add() #6 /var/www/vhosts/donpet.es/httpdocs/modules/paypal/paypal.php(1366): PaymentModuleCore->validateOrder(1625, 2, 3.37, '', 'Payment accepte...', Array, 1, false, '33bb4d287ceb91c...', Object(Shop)) #7 /var/www/vhosts/donpet.es/httpdocs/modules/paypal/express_checkout/payment.php(290 in /var/www/vhosts/donpet.es/httpdocs/classes/ObjectModel.php on line 866

 

IF EXPRESS CHEACKOUT ENABLED

Fatal error: Uncaught exception 'PrestaShopException' with message 'Property Order->payment is empty' in /var/www/vhosts/donpet.es/httpdocs/classes/ObjectModel.php:866 Stack trace: #0 /var/www/vhosts/donpet.es/httpdocs/classes/ObjectModel.php(272): ObjectModelCore->validateFields() #1 /var/www/vhosts/donpet.es/httpdocs/classes/order/Order.php(299): ObjectModelCore->getFields() #2 /var/www/vhosts/donpet.es/httpdocs/override/classes/order/Order.php(10): OrderCore->getFields() #3 /var/www/vhosts/donpet.es/httpdocs/classes/ObjectModel.php(480): Order->getFields() #4 /var/www/vhosts/donpet.es/httpdocs/classes/order/Order.php(304): ObjectModelCore->add(true, true) #5 /var/www/vhosts/donpet.es/httpdocs/classes/PaymentModule.php(335): OrderCore->add() #6 /var/www/vhosts/donpet.es/httpdocs/modules/paypal/paypal.php(1366): PaymentModuleCore->validateOrder(1625, 2, 4.33, '', 'Payment accepte...', Array, 1, false, '33bb4d287ceb91c...', Object(Shop)) #7 /var/www/vhosts/donpet.es/httpdocs/modules/paypal/express_checkout/payment.php(290 in /var/www/vhosts/donpet.es/httpdocs/classes/ObjectModel.php on line 866

 

The module appears on all of his hooks, apparently.

 

omg help :P

Link to comment
Share on other sites

  • 1 month later...
  • 8 months later...

i am facing a similar issue with the Instamojo Payment gateway.

 

the payment was carried out successfully and it did credit my Instamojo account with the payment but then after that there was no "Payment Success" page... nor did the order get created.

 

my shopping cart still shows the item pending for payment.

 

what should be done in this case??

Link to comment
Share on other sites

  • 1 month later...

Hello All

 

There are some missing values in paypalusa.php that's why you wont get order in Back office.

Please follow the link below and fix the problem.

You need to change in the following file.

modules/paypalusa/paypalusa.php

https://github.com/PrestaShop/PrestaShop-modules/pull/432/files#diff-5da7524100b2e4a68e32e136ed582c5cR423

I made the changes to the file and the next order that came though did not appear in Orders section, nor did it appear in the Shopping Carts section.  The customer does not exist either.  I have reverted back to the original file.  If anyone has a solution to the problem, I am all ears!

Link to comment
Share on other sites

  • 1 year later...

why do not come PayPal payment orders in prestashop back-office orders page?

In PrestaShop back-office orders page, PayPal payment orders are not created

I am using Prestashop version 1.5.6.

 

I used to payment method for paypalusa module version 1.3.9.

 

Module link

https://addons.prestashop.com/en/payment-card-wallet/8277-.html

 

I placed one or more order while using payment paypalusa module.

 

All transaction is completed but PrestaShop back-office orders page, PayPal payment orders do not come in orders page.

 

 

Products still there in cart page after transaction completed.

Link to comment
Share on other sites

  • 3 years later...

Hi, 

i face the same issue. and we have narrowed it down. the issue comes only from chrome browser and the module developer has given the below solution

"Please find below soltuion for Chrome null session response issue: The issue where cookies are getting NULL in return journey is occurring with chrome browser 84+ version. There is no restriction from PayU's end as such for cookies .

Solution Suggested:The chrome 84 security update says that SameSite attribute of cookie will be Lax(allowed for GET requests) by default and if we want cookie to travel then it should be marked SameSite : None and "Secure" explicitly. (Ref. https://web.dev/samesite-cookies-explained/"

 

 

Can anyone tell me how to apply this fix.

 

Thanks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...