X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Error persisting an order status change when Paypal Checkout is installed (https://forum.x-cart.com/showthread.php?t=78292)

relunacmx 09-10-2021 11:24 AM

Error persisting an order status change when Paypal Checkout is installed
 
Hi,

I created a small script that receives an order transaction ID and must change the order status to PAID.
require_once 'top.inc.php';

$tran_id = $_POST['transaction_id'];

$tran = \XLite\Core\Database::getRepo('\XLite\Model\Paymen t\Transaction')->findOneByPublicTxnId($tran_id);

$tran->setStatus($tran::STATUS_SUCCESS);
$tran->registerTransactionInOrderHistory();

$ord = $tran->getOrder();
$ord->setPaymentStatusByTransaction($tran);

\XLite\Core\Database::getEM()->persist($ord);
\XLite\Core\Database::getEM()->flush();
This was working fine until we installed the Paypal Checkout payment method. If the Paypal Checkout method is active, we get the following error in the last line of our code (marked red):

Class 'PayPalCheckoutSdk\Core\PayPalHttpClient' not found


The transaction gets updated to SUCCESS fine, but the error when calling the flush() function prevents the order from being updated to PAID.

The order we are updating doesn't use the Paypal Chekout at all, it has nothing to do with Paypal.


Best Regards,
Rafael Luna


All times are GMT -8. The time now is 10:22 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.