Skip to content

Commit

Permalink
Fixed order delete queries
Browse files Browse the repository at this point in the history
  • Loading branch information
L3RAZ committed Apr 8, 2024
1 parent 9afa4cb commit 2cf7bb9
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/Repository/PayPalOrderRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ public function getPayPalOrderByCartId($cartId)
$query = new DbQuery();
$query->select('*');
$query->from(PayPalOrder::TABLE, 'o');
$query->where('o.`id_cart` = ' . (int) $cartId);
$query->where(sprintf('o.`id_cart` = %d', (int) $cartId));
$queryResult = $this->db->getRow($query);
} catch (Exception $exception) {
Expand Down Expand Up @@ -161,11 +160,11 @@ public function getPayPalOrderByCartId($cartId)
public function deletePayPalOrder(PayPalOrderId $payPalOrderId)
{
try {
$this->db->delete(PayPalOrder::TABLE, sprintf('`id` = %s', pSQL($payPalOrderId->getValue())));
$this->db->delete(PayPalOrderAuthorization::TABLE, sprintf('`id_order` = %s', pSQL($payPalOrderId->getValue())));
$this->db->delete(PayPalOrderRefund::TABLE, sprintf('`id_order` = %s', pSQL($payPalOrderId->getValue())));
$this->db->delete(PayPalOrderCapture::TABLE, sprintf('`id_order` = %s', pSQL($payPalOrderId->getValue())));
$this->db->delete(PayPalOrderPurchaseUnit::TABLE, sprintf('`id_order` = %s', pSQL($payPalOrderId->getValue())));
$this->db->delete(PayPalOrder::TABLE, sprintf('`id` = "%s"', pSQL($payPalOrderId->getValue())));
$this->db->delete(PayPalOrderAuthorization::TABLE, sprintf('`id_order` = "%s"', pSQL($payPalOrderId->getValue())));
$this->db->delete(PayPalOrderRefund::TABLE, sprintf('`id_order` = "%s"', pSQL($payPalOrderId->getValue())));
$this->db->delete(PayPalOrderCapture::TABLE, sprintf('`id_order` = "%s"', pSQL($payPalOrderId->getValue())));
$this->db->delete(PayPalOrderPurchaseUnit::TABLE, sprintf('`id_order` = "%s"', pSQL($payPalOrderId->getValue())));
} catch (Exception $exception) {
throw new PsCheckoutException('Error while deleting PayPal Order', 0, $exception);
}
Expand Down

0 comments on commit 2cf7bb9

Please sign in to comment.