GithubHelp home page GithubHelp logo

dotpay's People

Contributors

mateuszpy avatar quetzacoalt91 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dotpay's Issues

Settings page

capture du 2015-01-05 15 26 38

On the settings page, only a small form is shown. There is currently no design and we do not know how the module works. Please use the other modules as example to introduce DotPay and add a design to the page. The HelperForm can help you.

JS errors with selling module called OnePageCheckout

Getting:
SyntaxError: unexpected token: keyword 'function'
Tracked down the issue to:
/dotpay/views/templates/front/scripts/payment.tpl
Result:
Form does not get constructed via JS, can't execute the payment

Fatal error: eval()'d code: Can't use function return value in write context

Problem was reported by one of our merchants:

[PrestaShop] Fatal error in module file :/home/.../classes/module/Module.php(1238) : eval()'d code: Can't use function return value in write context

PrestaShop version 1.6.0.11

User reported that after this error, whole section "Modules" in BO does not work.

Fatal error when the module is installed

  • Fatal error:

When I install the module a new fresh shop, I get the following error on the module configuration page in the BO:

Parse error: syntax error, unexpected '(int)' (int) (T_INT_CAST) in /home/modules/www/public_html/dotpay/modules/dotpay/dotpay.php on line 262
[PrestaShop] Fatal error in module file :/home/modules/www/public_html/dotpay/modules/dotpay/dotpay.php:
syntax error, unexpected '(int)' (int) (T_INT_CAST)

You should store the result of Configuration::get('DP_ID') before testing it.
In example:

        $dpid = (int)Configuration::get('DP_ID');
        if (empty($dpid)) return;
        [...]
  • Wrong URLC:

Sometimes the URL is not properly built. On my shop I get the following one:
http://.com/index.php?fc=module&module=dotpay&controller=callback&id_lang=1**?**ajax=1

We have a question mark two times in the url.

  • Notice shown during the payment process:

When I select DotPay as a payment provider, I get the following notice:
Notice: Undefined variable: return in /home/modules/www/public_html/dotpay/modules/dotpay/controllers/front/payment.php on line 90
capture du 2015-02-04 15 38 23

  • PHP compatibility:
    The line 70 in the file /controllers/front/payment.php won't be compatible with PHP 5.2:
'currency' => Currency::getCurrency($cart->id_currency)["iso_code"],

You should store the value of Currency::getCurrency($cart->id_currency) first, and then get the property ["iso_code"].

hookPaymentReturn is_guest check

[08-Feb-2015 16:16:28 Europe/Warsaw] PHP Notice: Undefined variable: is_guest in (...)\prestashop\modules\dotpay\dotpay.php on line 275

This error is caused by

if ($is_guest) $form_url=$this->context->link->getPageLink('guest-tracking', true);

in hookPaymentReturn.

Please advise how to determine if order was placed by guest?

Thanks,
Piotr Karecki

First review comments

Thanks for the commits of today, there are almost no errors anymore reported by the validator. Keep up the good work.

Here are other comments for the code:

  • /dotpay.php
    • The indentation is incorrect. You should have tabs instead of spaces.
    • l.7: The variable $urlc_param seems to be unused.
    • l.16: Because of a bug on PS 1.5, the variable $ps_version_compliancy does not work properly and must be removed.
    • install() function:
      • XOR is not a permitted operator and should be replaced with && and ||
      • Please avoid affectation of variable inside test condition (and even more for a function parameter)
    • hookPaymentReturn() function:
      • Add the following check at the begining of the function:
        if (!$this->active)
            return;
* Check if the customer is properly loaded:
        if (!Validate::isLoadedObject($customer))
            return;
  • tpl files
    • <img /> and <br/> must be closed immediately.
    • <center></center> becomes deprecated in HTML5. Please create or use a css class which use text-align:center;
    • /views/templates/hook/payment.php: The comment does not seem to be properly closed. (For more information: http://www.w3schools.com/tags/tag_comment.asp)
    • /views/templates/admin/content.tpl: ID and PIN should be
{l s='ID' mod='dotpay'}

and

{l s='PIN' mod='dotpay'}

Module doesn't show left column

MOdule doesn't show left column for module-dotpay-ocmanage module-dotpay-confirm even if it is checked in theme section and modules are hooked to left column for all pages

Pictures cross and tick

The two pictures you just added in your last commit are not properly shown.

Can you please convert them in PNG with a transparent background ?
Please also have a look to the URl, which is on my shop "/PrestaShop/modules/dotpay**//**img/cross.jpg" (Note the double slash)

Installation does not work

When I tried to install the module, I got the following error:
capture du 2015-01-05 15 16 21

I guess it is caused by the following lines:

            $order_state_new->name[Language::getIdByIso("pl")] = "Oczekuje potwierdzenia platnosci";
            $order_state_new->name[Language::getIdByIso("en")] = "Awaiting payment confirmation";

You should add the default value for every language and then set the specific value for poland:

        foreach (Language::getLanguages(false) as $language)
            $order_state_new->name[$language['id_lang']] = "Awaiting payment confirmation";
        $order_state_new->name[Language::getIdByIso("pl")] = "Oczekuje potwierdzenia platnosci";

The same change should be done for:

            $order_state_new->name[Language::getIdByIso("pl")] = "Rozpatorzna reklamacja";
            $order_state_new->name[Language::getIdByIso("en")] = "Complaint";

which should be

            foreach (Language::getLanguages(false) as $language)
                $order_state_new->name[$language['id_lang']] = "Complaint";
            $order_state_new->name[Language::getIdByIso("pl")] = "Rozpatorzna reklamacja";

Safari problem

Bug in Safari browser. Include this file (dotpay/views/templates/front/scripts/payment_widget.tpl ) in chlist.tpl causes a loading error on the rest of the page.

Controller for urlc.php

Setting a controller for urlc.php as you did for payment.php would be a good idea.

I know that you do not want to display the whole page, only a simple message. So I guess the function displayAjax() instead of initContent() could do the properly job for you (even if it is not the perfect function name for this case).

If you do this, you would be able to use the PS function in your script.

Order created too early

The order is created too early in the payment process. You must call the function validateOrder(...) when the user has paid on your payment interface and comes back to PrestaShop, not before the redirection to your interface.

Currently, I meet the following issue when I select DotPay but finally want another payment module:
Cart cannot be loaded or an order has already been placed using this cart. I never tried to pay, but the order has been successfully created.

Minor security bugfix

Unsafe SQL call:
/modules/dotpay/dotpay.php:99 add pSQL(Configuration::get(...

"UPDATE " . _DB_PREFIX_ . "order_state SET `deleted` = 1 WHERE id_order_state = " . Configuration::get('PAYMENT_DOTPAY_NEW_STATUS'),
"UPDATE " . _DB_PREFIX_ . "order_state SET `deleted` = 1 WHERE id_order_state = " . Configuration::get('PAYMENT_DOTPAY_COMPLAINT_STATUS')

Potentiall XSS:
/modules/dotpay/views/templates/front/payment_return.tpl:29 add escape|
/modules/dotpay/views/templates/hook/payment_return.tpl:29 add escape|

Module uninstallation

I just see the order status deletion when the module is uninstalled. If you do this, the orders which have already got this order status will lose some data, because they will be related to a non-existing order status.

You have to know that deleting them directly from the database is a really bad idea. The table order_state has a column deleted, which you should set as 1.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.