lightspeedretail / webstore

Web Store eCommerce solution for Lightspeed
http://www.lightspeedpos.com/webstore
Open Software License 3.0
85 stars 63 forks source link

Unpaid cart can't be paid when payment record is NULL in database #663

Closed brandinchiu closed 2 years ago

brandinchiu commented 9 years ago

Not sure if this has anything to do with updates.

When a completed cart record has a NULL entry in the database, the user can't manually mark the order as paid. Instead a PHP error is thrown:

Fatal error: Call to a member function hasErrors() on a non-object in /home/tmarker/public_html/core/framework/web/helpers/CHtml.php on line 2253

However, if the cart has a valid id, whose fields are all marked as NULL, then everything is fine. One of our clients received paypal payments for 3 different orders. All completed in the database, but none of the payments were created or attached to the orders -- which revealed this error.

gabeguz commented 9 years ago

Hey @brandinchiu - can you give us some more detail so we can reproduce the issue? Which field in the db is NULL when the error happens? The id_str?

Any more details you can provide will be helpful, thanks.

brandinchiu commented 9 years ago

in xlsws_cart record, the payment_id field is NULL. If you open up that order from the Admin Panel->System->DB->Unpaid Orders and try to manually set it to paid, you get a PHP error.

If that same record has a payment_id that links to an xlsws_cart_payment record (even with all fields marked as NULL), you can then mark the payment from the admin panel.

euoia commented 9 years ago

@brandinchiu thanks for that. Is the client using Paypal or Paypal Pro? Are you able to consistently reproduce the issue? If so, please provide the steps required.

brandinchiu commented 9 years ago

He's using regular Paypal. Not sure about reproduction, this is only the second time he has reported this problem.

brandinchiu commented 9 years ago

Just got another email from the client. Looks like it just happened again yesterday.

euoia commented 9 years ago

@brandinchiu is this still happening? I was unable to reproduce this. Do you have any more information for us?

brandinchiu commented 9 years ago

This is indeed still happening. We've only noticed the problem with two of our clients. Nothing really else to add. When the payment field in the xlwsw_cart record is set to NULL, as opposed to a xlsws_cart_payment record with all fields set to NULL, an error is thrown when that order is selected from the admin panel under System->Database Admin->Unpaid Orders.

This is the error that shows up in the popup when clicking on the WO-#### link.

Fatal error: Call to a member function hasErrors() on a non-object in /home/tmarker/public_html/core/framework/web/helpers/CHtml.php on line 2253