prestashopcorp / dotpay Goto Github PK
View Code? Open in Web Editor NEWDotpay payment module
Dotpay payment module
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
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.
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;
[...]
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.
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
'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"]
.
[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
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:
$urlc_param
seems to be unused.$ps_version_compliancy
does not work properly and must be removed.&&
and ||
if (!$this->active)
return;
* Check if the customer is properly loaded:
if (!Validate::isLoadedObject($customer))
return;
<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;
{l s='ID' mod='dotpay'}
and
{l s='PIN' mod='dotpay'}
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
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)
When I tried to install the module, I got the following error:
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";
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.
https://github.com/PrestaShop/dotpay/blob/master/controllers/front/callback.php#L60
You're trying to check the total amount of the "cart", not the one of the the "order".
So I could remove some products from my cart and it will change the price of the "order".
Thank you,
Kind regards.
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.
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.
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|
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.