PR #106 that was done to fix issue #105 unfortunately creates more issues. :/ The issues can be seen by going to the thank you page after completing an order so that the WC_Gateway_Swedbank_Pay_Cc::ajax_check_payment method is run. This'll trigger the WC_Swedbank_Pay_Transactions::import method and if the order already exists (i.e. the first if clause is not triggered) then the $wpdb->update(...) call triggers an error "WordPress database error Unknown column 'isOperational'..." and the method trows an Exception on line 331.. This in turns triggers a fatal error since WC_Gateway_Swedbank_Pay_Cc::ajax_check_payment is expecting an instance of \SwedbankPay\Core\Exception.
I guess the most common way for the order to already exist in the transaction table is because a callback has already come in from Swedbank pay to create it (that's how I noticed it). But you can also trigger this error by just reloading the thank you page after it has fetched the data from Swedbank.
Not sure why #106 changed from using $this->prepare and $this->update to using $wpdb. But if I change that back and just fix the two issues reported in #105 and change so both WC_Gateway_Swedbank_Pay_Cc::ajax_check_payment and WC_Swedbank_Pay_Transactions::import uses the same exception then everything seems to work great. :)
Hi,
PR #106 that was done to fix issue #105 unfortunately creates more issues. :/ The issues can be seen by going to the thank you page after completing an order so that the
WC_Gateway_Swedbank_Pay_Cc::ajax_check_payment
method is run. This'll trigger theWC_Swedbank_Pay_Transactions::import
method and if the order already exists (i.e. the first if clause is not triggered) then the$wpdb->update(...)
call triggers an error "WordPress database error Unknown column 'isOperational'..." and the method trows anException
on line 331.. This in turns triggers a fatal error sinceWC_Gateway_Swedbank_Pay_Cc::ajax_check_payment
is expecting an instance of\SwedbankPay\Core\Exception
.I guess the most common way for the order to already exist in the transaction table is because a callback has already come in from Swedbank pay to create it (that's how I noticed it). But you can also trigger this error by just reloading the thank you page after it has fetched the data from Swedbank.
Not sure why #106 changed from using
$this->prepare
and$this->update
to using$wpdb
. But if I change that back and just fix the two issues reported in #105 and change so bothWC_Gateway_Swedbank_Pay_Cc::ajax_check_payment
andWC_Swedbank_Pay_Transactions::import
uses the same exception then everything seems to work great. :)