Payment module problem



  • This is a payment module used in Latin America, I really need this module to work.

    Property OrderState->logable is not valid
    at line 1022 in file classes/ObjectModel.php

    1017.                }
    1018.    
    1019.                $message = $this->validateField($field, $this->$field);
    1020.                if ($message !== true) {
    1021.                    if ($die) {
    1022. =>                     throw new PrestaShopException($message);
    1023.                    }
    1024.    
    1025.                    return $errorReturn ? $message : false;
    1026.                }
    1027.            }
    
    • ObjectModelCore->validateFields - [line 321 - classes/ObjectModel.php]
    316.         * @since   1.0.0
    317.         * @version 1.0.0 Initial version
    318.         */
    319.        public function getFields()
    320.        {
    321. =>         $this->validateFields();
    322.            $fields = $this->formatFields(static::FORMAT_COMMON);
    323.    
    324.            // For retro compatibility
    325.            if (Shop::isTableAssociated($this->def['table'])) {
    326.                $fields = array_merge($fields, $this->getFieldsShop());
    
    • ObjectModelCore->getFields - [line 585 - classes/ObjectModel.php]
    580.    
    581.            // Database insertion
    582.            if (Shop::checkIdShopDefault($this->def['table'])) {
    583.                $this->id_shop_default = (in_array(Configuration::get('PS_SHOP_DEFAULT'), $idShopList) == true) ? Configuration::get('PS_SHOP_DEFAULT') : min($idShopList);
    584.            }
    585. =>         $fields = $this->getFields();
    586.            if (!$result = Db::getInstance()->insert($this->def['table'], $fields, $nullValues)) {
    587.                return false;
    588.            }
    589.    
    590.            // Get object id in database
    
    • ObjectModelCore->add - [line 282 - modules/mercadopago/mercadopago.php]
    277.                            $this->populateEmail($language['iso_code'], $value[2], 'html');
    278.                            $this->populateEmail($language['iso_code'], $value[2], 'txt');
    279.                        }
    280.                    }
    281.    
    282. =>                 if (!$order_state->add()) {
    283.                        return false;
    284.                    }
    285.    
    286.                    $file = _PS_ROOT_DIR_.'/img/os/'.(int) $order_state->id.'.gif';
    287.                    copy((dirname(__file__).'/views/img/mp_icon.gif'), $file);
    
    • MercadoPago->createStates - [line 332 - modules/mercadopago/mercadopago.php]
    327.                return false;
    328.            }
    329.    
    330.            $this->uninstallOverrideMercadoEnvios();
    331.            $this->dropTables();
    332. =>         if (!parent::install() || !$this->createStates() || !$this->registerHook('payment') ||
    333.                !$this->registerHook('paymentReturn') || !$this->registerHook('displayHeader') ||
    334.                !$this->registerHook('displayOrderDetail')
    335.                ||
    336.                !$this->registerHook('displayAdminOrder')
    337.                ||
    
    • MercadoPago->install - [line 1098 - controllers/admin/AdminModulesController.php]
    1093.                            } else {
    1094.                                $this->errors[] = Tools::displayError('Cannot reset this module.');
    1095.                            }
    1096.                        } else {
    1097.                            if ($module->uninstall()) {
    1098. =>                             if ($module->install()) {
    1099.                                    Tools::redirectAdmin(static::$currentIndex.'&conf=21&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name.'&anchor='.ucfirst($module->name));
    1100.                                } else {
    1101.                                    $this->errors[] = Tools::displayError('Cannot install this module.');
    1102.                                }
    1103.                            } else {
    
    • AdminModulesControllerCore->postProcessReset - [line 1499 - controllers/admin/AdminModulesController.php]
    1494.            $postProcessMethodsList = array_merge((array) $filterMethods, (array) $callbackMethods);
    1495.            foreach ($postProcessMethodsList as $ppm) {
    1496.                if (Tools::isSubmit($ppm)) {
    1497.                    $ppm = 'postProcess'.ucfirst($ppm);
    1498.                    if (method_exists($this, $ppm)) {
    1499. =>                     $ppmReturn = $this->$ppm();
    1500.                    }
    1501.                }
    1502.            }
    1503.    
    1504.            // Call appropriate module callback
    
    • AdminModulesControllerCore->postProcess - [line 355 - classes/controller/Controller.php]
    350.                if ($this->checkAccess()) {
    351.                    if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) {
    352.                        $this->setMedia();
    353.                    }
    354.    
    355. =>                 $this->postProcess();
    356.    
    357.                    if (!empty($this->redirect_after)) {
    358.                        $this->redirect();
    359.                    }
    360.    
    
    • ControllerCore->run - [line 743 - classes/Dispatcher.php]
    738.                if (isset($paramsHookActionDispatcher)) {
    739.                    Hook::exec('actionDispatcher', $paramsHookActionDispatcher);
    740.                }
    741.    
    742.                // Running controller
    743. =>             $controller->run();
    744.            } catch (PrestaShopException $e) {
    745.                $e->displayMessage();
    746.            }
    747.        }
    748.    
    
    • DispatcherCore->dispatch - [line 63 - admin/index.php]
    58.    if (!isset($_REQUEST['controller']) && isset($_REQUEST['tab'])) {
    59.        $_REQUEST['controller'] = strtolower($_REQUEST['tab']);
    60.    }
    61.    
    62.    // Prepare and trigger admin dispatcher
    63. => Dispatcher::getInstance()->dispatch();
    

    0_1508271755866_mercadopago.zip

    @mdekker Help! 😢



  • Why does it have to create states?

    Can’t you just comment out $this->createStates() from line 332 - modules/mercadopago/mercadopago.php ? It doesn’t seem right to me.



  • @mdekker
    @Baarssen

    It worked!!!
    you are very efficient! (corrected)

    Can I propose the removal of this in github? will it damage the installation in prestashop?

    How do I give you your credit when I ask for correction?

    0_1508335188076_mlok.png



  • @anima said in Payment module problem:

    @mdekker

    It worked!!!
    You fucking great fuck! (in pt-br this is a compliment)
    😬 👏🏼



  • Oh in english
    fuck = shit?

    I have to study more English hahahaha

    always helped me a lot, even in this case where tb does not support.

    @mdekker always helped me a lot, even in this case where tb does not support.

    for correction https://github.com/mercadopago/cart-prestashop/issues/189

    aykou created this issue in mercadopago/cart-prestashop

    closed Problem #189



  • I think the same problem occurs in PrestaShop if I look at the code. It doesn’t work when some states have already been set up properly. Make sure you manually check the countries you want to support and if they have all the right regions configured.


 

Looks like your connection to thirty bees forum was lost, please wait while we try to reconnect.