View Single Post
  #1  
Old 09-10-2021, 11:24 AM
 
relunacmx relunacmx is offline
    
Join Date: Sep 2021
Posts: 1
 

Default 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
__________________
X-Cart 5.4.1.31
Reply With Quote