PrestaShopCorp / openpayprestashop

Accept payments by credit-debit card, cash payments and via SPEI with Openpay
1 stars 4 forks source link

Error on module installation with PrestaShop cloud store #10

Open Quetzacoalt91 opened 9 years ago

Quetzacoalt91 commented 9 years ago

Hi,

I have been notified on the following error:

[PrestaShop] Fatal error in module file :/home/pca8613516/www/ftp/modules/openpayprestashop/openpayprestashop.php:
Uncaught exception 'Exception' in /home/pca8613516/www/ftp/modules/openpayprestashop/openpayprestashop.php:997 Stack trace: #0 /home/pca8613516/www/ftp/modules/openpayprestashop/openpayprestashop.php(132): OpenpayPrestashop->copyMailTemplate() #1 /home/pca8613516/www/ftp/modules/openpayprestashop/openpayprestashop.php(90): OpenpayPrestashop->createPendingState() #2 /core/www/core_1.6.0.14/controllers/admin/AdminModulesController.php(846): OpenpayPrestashop->install() #3 /core/www/core_1.6.0.14/controllers/admin/AdminModulesController.php(1094): AdminModulesControllerCore->postProcessCallback() #4 /core/www/core_1.6.0.14/classes/controller/Controller.php(171): AdminModulesControllerCore->postProcess() #5 /core/www/core_1.6.0.14/classes/Dispatcher.php(373): ControllerCore->run() #6 /core/www/core_1.6.0.14/backoffice/index.php(54): DispatcherCore->dispatch() #7 /core/www/index.php(100): include_once('/core/www/core_...') #8 /home/pca8613516/www/backoffice/index.php(26): include_once('/core/www/index...') #9 {mai

Here is the PHP documentation about the Exceptions: http://php.net/manual/en/language.exceptions.php

The merchant meets this error because an Exception is thrown, but never caught. In order to fix this, a handler needs to be added. Here is an example:

    private function createPendingState()
    {
        [...] 

        if ($state->save())
        {
            try {
                Configuration::updateValue('waiting_cash_payment', $state->id);
                $this->copyMailTemplate();
            }
            catch (Exception e)
            {
                    // Something to do in case of exception
            }

        }
        [...]
    }

Best regards

fedebalderas commented 9 years ago

Hi Thomas, I've been working on that and it was fixed (handled error), but still don't push. What can we do about /email folder permissions on cloud store. By the way, is there a official documentation about send customized emails on PrestaShop?

Regards!

Quetzacoalt91 commented 9 years ago

Hi Federico,

You have a mail folder available, which can be found in the theme. On a cloud store, the merchant has read and write access to this part.

Best regards

fedebalderas commented 9 years ago

how merchant can do that in cloud store? I attach image about tutorial i've been following to associate a email to OrderState()

associating an e-mail with an order state - prestashop module development 2015-09-08 10-34-48

fedebalderas commented 9 years ago

This issue was fixed and released in the new version (Bitcoins payment).