Jump to content

Mobile Wallet: error with Validation.php


Recommended Posts

Something is wrong with my validation.php in the controllers. When i click, Place my order i'm redirected to  http://127.0.0.1/uthenga/index.php?fc=module&module=mobilewallet&controller=validation

 

But then i get the page saying that something went wrong. Pasted below is my validation.php code 

 

<?php
 
class MobilewalletValidationModuleFrontController extends ModuleFrontController
 
{
 
public function postProcess()
{
$cart = $this->context->cart;
if ($cart->id_customer == 0 || $cart->id_address_delivery == 0 || $cart->id_address_invoice == 0 || !$this->module->active)
Tools::redirect('index.php?controller=order&step=1');
 
// Check that this payment option is still available in case the customer changed his address just before the end of the checkout process
$authorized = false;
foreach (Module::getPaymentModules() as $module)
if ($module['name'] == 'mobilewallet')
{
$authorized = true;
break;
}
if (!$authorized)
die($this->module->l('This payment method is not available.', 'validation'));
 
$customer = new Customer($cart->id_customer);
if (!Validate::isLoadedObject($customer))
Tools::redirect('index.php?controller=order&step=1');
 
$total = (float)$cart->getOrderTotal(true, Cart::BOTH);
$this->module->validateOrder($cart->id,$total, $this->module->displayName, NULL, false, $customer->secure_key);
Tools::redirect('index.php?controller=order-confirmation&id_cart='.$cart->id.'&id_module='.$this->module->id.'&id_order='.$this->module->currentOrder.'&key='.$customer->secure_key);
}
}
 
Link to comment
Share on other sites

Hi,

Is it about the Mobile Wallet module? Can you confirm it? Just to know it, I'll change the topic title so that it's more meaningful :)

 Upon turning on error reporting, im now arriving at this.

Can't load Order state status. And the highlighted line is :

 

 

34.         $this->module->validateOrder($cart->id,Configuration::get('MOBILEWALLET_NAME'), $total, $this->module->displayName, NULL, NULL, (int)$currency->id, false, $customer->secure_key);

35.         Tools::redirect('index.php?controller=order-confirmation&id_cart='.$cart->id.'&id_module='.$this->module->id.'&id_order='.$this->module->currentOrder.'&key='.$customer->secure_key);

Link to comment
Share on other sites

It seems that you are missing a configuration parameter. FIrst, try uninstalling and reinstalling the module.
 
If this doesn't solve it, create a new order status named like 'Mobile Wallet Payment accepted', write down the id. Then login into your database, open the ps_configuration tab and add a new row where the name is MOBILEWALLET_NAME, and value equals to the order state ID you wrote down. This should solve it :)

Link to comment
Share on other sites

It seems that you are missing a configuration parameter. FIrst, try uninstalling and reinstalling the module.

 

If this doesn't solve it, create a new order status named like 'Mobile Wallet Payment accepted', write down the id. Then login into your database, open the ps_configuration tab and add a new row where the name is MOBILEWALLET_NAME, and value equals to the order state ID you wrote down. This should solve it :)

A lil puzzled on making the order state ... 

Must i be using the Configuration::updateValue?

Link to comment
Share on other sites

×
×
  • Create New...