Jump to content
thirty bees forum
  • 0

Paypal module error message - Unknown column 'id_payer' in 'field list'


Question

Posted (edited)

When a customer goes through the checkout after they make payment with Paypal they get the error message:

Unknown column 'id_payer' in 'field list'
in file modules/paypal/classes/PayPalOrder.php at line 225
Source file: modules/paypal/classes/PayPalOrder.php
206:
207:        if (!isset($transaction['payment_status']) || !$transaction['payment_status']) {
208:            $transaction['payment_status'] = 'NULL';
209:        }
210:
211:        Db::getInstance()->insert(
212:            bqSQL(self::$definition['table']),
213:            [
214:                'id_order' => (int) $idOrder,
215:                'id_payer' => pSQL($transaction['id_payer']),
216:                'id_payment' => pSQL($transaction['id_payment']),
217:                'id_transaction' => pSQL($transaction['id_transaction']),
218:                'id_invoice' => pSQL($transaction['id_invoice']),
219:                'currency' => pSQL($transaction['currency']),
220:                'total_paid' => $totalPaid,
221:                'shipping' => (float) $transaction['shipping'],
222:                'capture' => (int) Configuration::get('PAYPAL_CAPTURE'),
223:                'payment_date' => pSQL($transaction['payment_date']),
224:                'payment_method' => (int) Configuration::get('PAYPAL_PAYMENT_METHOD'),
225:                'payment_status' => pSQL($transaction['payment_status']),
226:            ]
227:        );
228:    }
229:}

The order is created in the 30bees BO, but the customer does not get sent to the order confirmation screen or receive the confirmation order email

I recently upgraded from 1.4.0 to 1.50 and never experienced this when on 1.4.0 but its happened on all new orders since i upgraded to 1.5.0.

I am using paypal module v5.6.1 and Website Payments standard.

Any help would be most appreciated as it often results in the customer refreshing the error page and then this creates duplicate orders which is more admin to then have to cancel and refund.

Below is the information for the stack trace on the error page

1. classes/db/Db.php:235 source ()
2. classes/db/Db.php:441 source DbCore->displayError()
3. classes/db/Db.php:998 source DbCore->query()
4. modules/paypal/classes/PayPalOrder.php:225 source DbCore->insert()
5. modules/paypal/paypal.php:1553 source PayPalModule\PayPalOrder::saveOrder()
6. modules/paypal/controllers/front/expresscheckout.php:457 source PayPal->validateOrder()
7. modules/paypal/controllers/front/expresscheckout.php:214 source PayPalexpresscheckoutModuleFrontController->validateOrder()
8. modules/paypal/controllers/front/expresscheckout.php:63 source PayPalexpresscheckoutModuleFrontController->processPayment()
9. classes/controller/Controller.php:209 source PayPalexpresscheckoutModuleFrontController->initContent()
10. classes/controller/FrontController.php:264 source ControllerCore->run()
11. classes/Dispatcher.php:851 source FrontControllerCore->run()
12. ./index.php:33 source DispatcherCore->dispatch()

 

Edited by ukclearance

3 answers to this question

Recommended Posts

  • 0
Posted

Ok so after a bit of research by comparing a clean 1.5.1 install with the Paypal module installed and my upgraded version I could see i was missing some fields in the Paypal_order table in the database
id_payer
id_payment

So i added these fields manually and did a test order and it seems to have gone through successfully without any error being thrown up after being returned back to my website, and checking the database shows that there is now data being recorded for id_payer and id_payment in those fields for my test order.

So hopefully that has resolve the issue. But if someone with more knowledge on this has any further things I should be checking please let me know.

  • Thanks 1
  • 0
Posted

Older versions of thirty bees silently ignored errors raised by database. For example, when some module attempted to insert data into non-existing table (or column), the insert statement simply returned false. Most of the time, code didn't check return status, and happily continued. That in turn usually caused a lot of trouble later. And it was very hard to detect the root cause of those problems.

Newer versions of thirty bees do not ignore those db errors by default. When module tries to insert data into non-existing table or column, the exception is thrown immediately -- store owner therefore knows what's wrong, and can fix it (ie. create missing columns, as @ukclearance did)

You can disable this behaviour by enabling 'Ignore SQL errors', but I strongly advice against that. Fail fast is very good for you, in long term

image.png.6dccf32291abcb0f6a5106d03b893b02.png

 

  • 0
Posted

That probably explains why i only started to get the errors after upgrading, as my store was originally created on Prestashop 1.3 and has been upgraded many times over the years and who knows if there are other issues with the database that I am still unaware of.

Maybe I should look at exporting my products and customers and importing them into a clean install and setting my store up again. But I don't really know how to go about with doing that and how big of a job it would be

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...