removed extra order statuses and updated module statuses

This commit is contained in:
Shreesh Arora
2022-08-01 16:04:31 +05:30
parent 31fcd01ef9
commit 2dc9a6860e
79 changed files with 1009 additions and 1309 deletions

View File

@@ -33,6 +33,16 @@ abstract class PaymentModuleCore extends Module
const DEBUG_MODE = false;
const PAYMENT_TYPE_ONLINE = 1;
const PAYMENT_TYPE_PAY_AT_HOTEL = 2;
const PAYMENT_TYPE_REMOTE_PAYMENT = 3;
public function __construct()
{
parent::__construct();
$this->payment_type = PaymentModule::PAYMENT_TYPE_REMOTE_PAYMENT;
}
public function install()
{
if (!parent::install()) {
@@ -305,6 +315,7 @@ abstract class PaymentModuleCore extends Module
$order->secure_key = ($secure_key ? pSQL($secure_key) : pSQL($this->context->customer->secure_key));
$order->payment = $payment_method;
$order->payment_type = $this->payment_type;
if (isset($this->name)) {
$order->module = $this->name;
}
@@ -432,7 +443,7 @@ abstract class PaymentModuleCore extends Module
$transaction_id = null;
}
if (!isset($order) || !Validate::isLoadedObject($order) || !$order->addOrderPayment($amount_paid, null, $transaction_id)) {
if (!isset($order) || !Validate::isLoadedObject($order) || !$order->addOrderPayment($amount_paid, null, PaymentModule::PAYMENT_TYPE_ONLINE , $transaction_id)) {
PrestaShopLogger::addLog('PaymentModule::validateOrder - Cannot save Order Payment', 3, null, 'Cart', (int)$id_cart, true);
throw new PrestaShopException('Can\'t save Order Payment');
}