fix callback context
This commit is contained in:
@@ -445,7 +445,7 @@ class Hutko extends PaymentModule
|
|||||||
$products[] = [
|
$products[] = [
|
||||||
"id" => (int)$cartProduct['id_product'],
|
"id" => (int)$cartProduct['id_product'],
|
||||||
"name" => $cartProduct['name'],
|
"name" => $cartProduct['name'],
|
||||||
"price" => (float)$cartProduct['price'],
|
"price" => round((float)$cartProduct['price_with_reduction'], 2),
|
||||||
"total_amount" => round((float) $cartProduct['price'] * (int)$cartProduct['quantity'], 2),
|
"total_amount" => round((float) $cartProduct['price'] * (int)$cartProduct['quantity'], 2),
|
||||||
"quantity" => (int)$cartProduct['quantity'],
|
"quantity" => (int)$cartProduct['quantity'],
|
||||||
];
|
];
|
||||||
@@ -473,9 +473,9 @@ class Hutko extends PaymentModule
|
|||||||
if (!$idState) {
|
if (!$idState) {
|
||||||
$idState = (int) Configuration::get('PS_OS_PREPARATION');
|
$idState = (int) Configuration::get('PS_OS_PREPARATION');
|
||||||
}
|
}
|
||||||
if (!$fromCallBack) {
|
if ($fromCallBack) {
|
||||||
$cart = new Cart($id_cart);
|
$this->context->cart = new Cart($id_cart);
|
||||||
$this->context->customer = new Customer($cart->id_customer);
|
$this->context->customer = new Customer($this->context->cart->id_customer);
|
||||||
}
|
}
|
||||||
// Call the parent validateOrder method with the "preparation" status.
|
// Call the parent validateOrder method with the "preparation" status.
|
||||||
return $this->validateOrder($id_cart, $idState, $amount, $this->displayName, null, ['transaction_id' => $transaction_id], null, false, $this->context->customer->secure_key);
|
return $this->validateOrder($id_cart, $idState, $amount, $this->displayName, null, ['transaction_id' => $transaction_id], null, false, $this->context->customer->secure_key);
|
||||||
|
|||||||
Reference in New Issue
Block a user