Jump to content

Recommended Posts

Hi all, I started to created custom payment plugin from cheque plugin to "Pay by omni" method, But when i click "confirm order" it shows some errors on page of validation url.

 

Errors are:

[PrestaShopException]

 

Can't load Order state status

at line 145 in file classes/PaymentModule.php

 

139. if (Configuration::get('PS_TAX_ADDRESS_TYPE') == 'id_address_delivery')

140. $context_country = $this->context->country;

141.

142. $order_status = new OrderState((int)$id_order_state, (int)$this->context->language->id);

143. if (!Validate::isLoadedObject($order_status))

144. throw new PrestaShopException('Can\'t load Order state status');

145.

146. if (!$this->active)

147. die(Tools::displayError());

148. // Does order already exists ?

149. if (Validate::isLoadedObject($this->context->cart) && $this->context->cart->OrderExists() == false)

  • PaymentModuleCore->validateOrder - [line 64 - modules/omni/controllers/front/validation.php] - [9 Arguments]
     
    58. $mailVars = array(
    59. '{omni_name}' => Configuration::get('OMNI_NAME'),
    60. '{omni_address}' => Configuration::get('OMNI_ADDRESS'),
    61. '{omni_address_html}' => str_replace("\n", '<br />', Configuration::get('OMNI_ADDRESS')));
    62.
    63. $this->module->validateOrder((int)$cart->id, Configuration::get('PS_OS_OMNI'), $total, $this->module->displayName, NULL, $mailVars, (int)$currency->id, false, $customer->secure_key);
    64. Tools::redirect('index.php?controller=order-confirmation&id_cart='.(int)$cart->id.'&id_module='.(int)$this->module->id.'&id_order='.$this->module->currentOrder.'&key='.$customer->secure_key);
    65. }
    66. }
  • OmniValidationModuleFrontController->postProcess - [line 158 - classes/controller/Controller.php] - [0 Argument]
     
    152. // setMedia MUST be called before postProcess
    153. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className)))
    154. $this->setMedia();
    155.
    156. // postProcess handles ajaxProcess
    157. $this->postProcess();
    158.
    159. if (!empty($this->redirect_after))
    160. $this->redirect();
    161.
    162. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className)))
  • ControllerCore->run - [line 349 - classes/Dispatcher.php] - [0 Argument]
     
    343. // Execute hook dispatcher
    344. if (isset($params_hook_action_dispatcher))
    345. Hook::exec('actionDispatcher', $params_hook_action_dispatcher);
    346.
    347. // Running controller
    348. $controller->run();
    349. }
    350. catch (PrestaShopException $e)
    351. {
    352. $e->displayMessage();
    353. }
  • DispatcherCore->dispatch - [line 28 - index.php] - [0 Argument]
     
    22. * @license http://opensource.or...ses/osl-3.0.php Open Software License (OSL 3.0)
    23. * International Registered Trademark & Property of PrestaShop SA
    24. */
    25.
    26. require(dirname(__FILE__).'/config/config.inc.php');
    27. Dispatcher::getInstance()->dispatch();
    28.

please guide me. I am new to web development field.

 

You can download model from this link. http://dhondo.com/kakar/omni.zip

 

 

I also use bankwire2 plugin for this task but it show previously install bankwire module data. So, Please every body help me. Bcz I am stucked.

 

 

You can also visit my sample shop at http://shop.dhondo.com

omni.zip

Link to comment
Share on other sites

Hi,

You're not apassing a valid order state. You need to create an or5der state to be associated to your module before trying to process any payment. The message pops out because the system doesn't know to which status it must refer after creating the order

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...