secure_key fix
This commit is contained in:
@@ -113,7 +113,7 @@ class HutkoCallbackModuleFrontController extends ModuleFrontController
|
|||||||
}
|
}
|
||||||
// If order still doesn't exist, proceed with validation.
|
// If order still doesn't exist, proceed with validation.
|
||||||
$idState = (int)Configuration::get('HUTKO_SUCCESS_STATUS_ID');
|
$idState = (int)Configuration::get('HUTKO_SUCCESS_STATUS_ID');
|
||||||
return $this->module->validateOrderFromCart((int)$cart->id, $amountReceived, $transaction_id, $idState);
|
return $this->module->validateOrderFromCart((int)$cart->id, $amountReceived, $transaction_id, $idState, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Postpone validation to seconds ending in 8 to avoid collision with result controller (ending in 3).
|
// Postpone validation to seconds ending in 8 to avoid collision with result controller (ending in 3).
|
||||||
|
|||||||
@@ -468,11 +468,15 @@ class Hutko extends PaymentModule
|
|||||||
* @return bool True if the order validation was successful, false otherwise.
|
* @return bool True if the order validation was successful, false otherwise.
|
||||||
* @see PaymentModule::validateOrder()
|
* @see PaymentModule::validateOrder()
|
||||||
*/
|
*/
|
||||||
public function validateOrderFromCart(int $id_cart, float $amount, string $transaction_id = '', int $idState = 0): bool
|
public function validateOrderFromCart(int $id_cart, float $amount, string $transaction_id = '', int $idState = 0, bool $fromCallBack = false): bool
|
||||||
{
|
{
|
||||||
if (!$idState) {
|
if (!$idState) {
|
||||||
$idState = (int) Configuration::get('PS_OS_PREPARATION');
|
$idState = (int) Configuration::get('PS_OS_PREPARATION');
|
||||||
}
|
}
|
||||||
|
if (!$fromCallBack) {
|
||||||
|
$cart = new Cart($id_cart);
|
||||||
|
$this->context->customer = new Customer($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);
|
||||||
}
|
}
|
||||||
@@ -828,7 +832,6 @@ class Hutko extends PaymentModule
|
|||||||
if ($response['response']['response_status'] === 'success') {
|
if ($response['response']['response_status'] === 'success') {
|
||||||
$result->success = true;
|
$result->success = true;
|
||||||
$result->description = $this->trans('Refund success.', [], 'Modules.Hutko.Admin');
|
$result->description = $this->trans('Refund success.', [], 'Modules.Hutko.Admin');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$order = new Order($orderId);
|
$order = new Order($orderId);
|
||||||
|
|||||||
Reference in New Issue
Block a user