Giter Site home page Giter Site logo

hipay / hipay-enterprise-sdk-prestashop Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 11.0 12.6 MB

Official repository of the HiPay Enterprise module for PrestaShop.

License: Apache License 2.0

Shell 2.21% PHP 59.59% Smarty 18.96% JavaScript 12.01% CSS 0.91% HTML 6.33%

hipay-enterprise-sdk-prestashop's People

Contributors

etiennelandais avatar hipaybot avatar jbaptistelvt avatar jprotin avatar legithubdeaymeric avatar thibautgdt avatar tviardin avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hipay-enterprise-sdk-prestashop's Issues

HiPay Entreprise - missing HipayDBQuery class

Hi,

I tried to install the module on a 1.6 PrestaShop, and received the next error :
[PrestaShop] Fatal error in module file : /modules/hipay_enterprise/upgrade/Upgrade-2.3.0.php:
Class 'HipayDBQuery' not found
I checked in the code, and the class mentioned is empty, it seems to be the same in the sources.
I replaced in my code by an old version.
Could you confirm it is ok to do that ?
And put the class again in the repository ?

Thanks,

Jean-Marc Peterkenne

Weird upgrades

Hi,

I've noticed several problems with your upgrade files.
First of all, 2.18.0 and 2.20.0 are executing the same query, resulting in a SQL exception failing the upgrade. SQL query from 2.20 has to be removed.

Second, the 2.21.4 does not return true at the end of the upgrade, resulting in a fail upgrade.

Thanks.

Installation failed because log directory doesn't exists in Prestashop 1.7

Hi,
When I want to install the latest version 2.2.5 of your module on a prestashop 1.7.4.0, I have a message in the backoffice that appears to tell me that the installation failed because it could not write the log file at the root of the site. This folder doesn't exist by default in prestashop 1.7.

I created manually the file and the installation is done properly. It might be necessary to manage differently the writing of the logs if one is in 1.7

Redirect ctrl 500 with HOSTED_FIELDS

Hi,

Why there are no check on PS version here ? This lead to a 500 because you try to use 16 template instead 17...

case UXMode::DIRECT_POST:
case UXMode::HOSTED_FIELDS:
$this->assignTemplate();
$path = 'payment/ps16/paymentForm-' . $uxMode . '-16.tpl';
break;

You just need to do the same thing as below:

$path = (_PS_VERSION_ >= '1.7' ? 'module:' .
        $this->module->name .
        '/views/templates/front/payment/ps17/paymentForm-' . $uxMode . '-17'
        : 'payment/ps16/paymentForm-' . $uxMode . '-16') . '.tpl';

Commande KO avec livraison gratuite / order KO with free shipping

FR

Bonjour,

Je crée cette issue car nous rencontrons un problème sur notre boutique lié à la création de certaines commandes :

Contexte :
Pour certaines commandes, nous créons la commande dans le back-office en cochant l'option de livraison gratuite. Ensuite, lorsque nous passons à la validation de la commande (via le front-end ou la méthode MoTo), la commande est annulée en raison d'une erreur, comme le montre la capture d'écran ci-jointe.

Screenshot_324
Screenshot_325
Screenshot_326

Reproduction :

  1. Créer une commande depuis le back-office.
  2. Sélectionner un client, un ou plusieurs produits, et une adresse de livraison/facturation.
  3. Choisir un mode de livraison.
  4. Cocher l'option "Livraison gratuite".
  5. Dans le Back-Office :
    a: Créer la commande avec le statut "En attente de paiement MO/TO (HiPay)".
    b: Valider la commande avec un moyen de paiement valide (ou un moyen de test si la boutique est en mode test).
  6. Dans le Front-End :
    a: Choisir le mode de paiement par carte bancaire (HiPay).
    b: Remplir les champs avec un moyen de paiement valide (ou un moyen de test si la boutique est en mode test) et valider la commande.
  7. La commande échoue.

Voici les erreurs que nous trouvons dans les logs du module :

2023/12/07 - 15:23:32: HipayLogs:logException:Invalid format basket
2023/12/07 - 15:23:32: HipayLogs:logException:#0 /public_html/modules/hipay_enterprise/lib/vendor/hipay/hipay-fullservice-sdk-php/lib/HiPay/Fullservice/HTTP/ClientProvider.php(93): HiPay\Fullservice\HTTP\SimpleHTTPClient->doRequest('POST', 'v1/order', Array, false, false)
#1 /public_html/modules/hipay_enterprise/lib/vendor/hipay/hipay-fullservice-sdk-php/lib/HiPay/Fullservice/Gateway/Client/GatewayClient.php(147): HiPay\Fullservice\HTTP\ClientProvider->request('POST', 'v1/order', Array)
#2 /public_html/modules/hipay_enterprise/classes/apiCaller/ApiCaller.php(141): HiPay\Fullservice\Gateway\Client\GatewayClient->requestNewOrder(Object(HiPay\Fullservice\Gateway\Request\Order\OrderRequest))
#3 /public_html/modules/hipay_enterprise/classes/apiHandler/ApiHandler.php(429): ApiCaller::requestDirectPost(Object(Hipay_enterprise), Array)
#4 /public_html/modules/hipay_enterprise/classes/apiHandler/ApiHandler.php(108): Apihandler->handleDirectOrder(Array)
#5 /public_html/modules/hipay_enterprise/controllers/front/redirect.php(310): Apihandler->handleCreditCard('direct_post', Array)
#6 /public_html/modules/hipay_enterprise/controllers/front/redirect.php(127): Hipay_enterpriseRedirectModuleFrontController->apiNewCC(Object(Cart), Object(Context), Object(Customer), false, false)
#7 /public_html/classes/controller/Controller.php(295): Hipay_enterpriseRedirectModuleFrontController->postProcess()
#8 /public_html/classes/Dispatcher.php(525): ControllerCore->run()
#9 /public_html/index.php(28): DispatcherCore->dispatch()
#10 {main}
Screenshot_327

En activant le mode débug, nous obtenons un peu plus d'informations sur l'origine du problème :

2023/12/07 - 15:41:38: HipayLogs:logException:Warning: Division by zero
2023/12/07 - 15:41:38: HipayLogs:logException:#0 /public_html/modules/hipay_enterprise/classes/apiFormatter/Cart/CartFormatter.php(76): CartFormatter->getFeesItem(Array)
#1 /public_html/modules/hipay_enterprise/classes/apiFormatter/Cart/CartFormatter.php(43): CartFormatter->mapRequest(Object(HiPay\Fullservice\Gateway\Model\Cart\Cart))
#2 /public_html/modules/hipay_enterprise/classes/apiHandler/ApiHandler.php(360): CartFormatter->generate()
#3 /public_html/modules/hipay_enterprise/classes/apiHandler/ApiHandler.php(339): Apihandler->getCart(Object(CartFormatter))
#4 /public_html/modules/hipay_enterprise/classes/apiHandler/ApiHandler.php(96): Apihandler->baseParamsInit(Array)
#5 /public_html/modules/hipay_enterprise/controllers/front/redirect.php(310): Apihandler->handleCreditCard('direct_post', Array)
#6 /public_html/modules/hipay_enterprise/controllers/front/redirect.php(127): Hipay_enterpriseRedirectModuleFrontController->apiNewCC(Object(Cart), Object(Context), Object(Customer), false, false)
#7 /public_html/classes/controller/Controller.php(295): Hipay_enterpriseRedirectModuleFrontController->postProcess()
#8 /public_html/classes/Dispatcher.php(525): ControllerCore->run()
#9 /public_html/index.php(28): DispatcherCore->dispatch()
#10 {main}
Screenshot_328

Informations sur l'environnement :

Version du module : v2.20.0
Version de PrestaShop : 1.7.8.10
Version PHP : 7.4.33


EN

Hello,

I am creating this issue because we are experiencing a problem on our shop related to the creation of certain orders:

Context:
For some orders, we create the order in the back-office by checking the option for free shipping. Then, when we proceed to validate the order (via the front-end or the MoTo method), the order gets canceled due to an error, as shown in the attached screenshot.

Reproduction:

  1. Create an order from the back-office.
  2. Select a customer, one or more products, and a delivery/billing address.
  3. Choose a shipping method.
  4. Check the "Free Shipping" option.
  5. In the Back-Office:
    a. Create the order with the status "Awaiting MO/TO Payment (HiPay)."
    b. Validate the order with a valid payment method (or a test method if the shop is in test mode).
  6. In the Front-End:
    a. Choose the payment method by credit card (HiPay).
    b. Fill in the fields with a valid payment method (or a test method if the shop is in test mode) and validate the order.
  7. => The order fails.

Here are the errors we find in the module's logs:

2023/12/07 - 15:23:32: HipayLogs:logException:Invalid format basket
2023/12/07 - 15:23:32: HipayLogs:logException:#0 /public_html/modules/hipay_enterprise/lib/vendor/hipay/hipay-fullservice-sdk-php/lib/HiPay/Fullservice/HTTP/ClientProvider.php(93): HiPay\Fullservice\HTTP\SimpleHTTPClient->doRequest('POST', 'v1/order', Array, false, false)
#1 /public_html/modules/hipay_enterprise/lib/vendor/hipay/hipay-fullservice-sdk-php/lib/HiPay/Fullservice/Gateway/Client/GatewayClient.php(147): HiPay\Fullservice\HTTP\ClientProvider->request('POST', 'v1/order', Array)
#2 /public_html/modules/hipay_enterprise/classes/apiCaller/ApiCaller.php(141): HiPay\Fullservice\Gateway\Client\GatewayClient->requestNewOrder(Object(HiPay\Fullservice\Gateway\Request\Order\OrderRequest))
#3 /public_html/modules/hipay_enterprise/classes/apiHandler/ApiHandler.php(429): ApiCaller::requestDirectPost(Object(Hipay_enterprise), Array)
#4 /public_html/modules/hipay_enterprise/classes/apiHandler/ApiHandler.php(108): Apihandler->handleDirectOrder(Array)
#5 /public_html/modules/hipay_enterprise/controllers/front/redirect.php(310): Apihandler->handleCreditCard('direct_post', Array)
#6 /public_html/modules/hipay_enterprise/controllers/front/redirect.php(127): Hipay_enterpriseRedirectModuleFrontController->apiNewCC(Object(Cart), Object(Context), Object(Customer), false, false)
#7 /public_html/classes/controller/Controller.php(295): Hipay_enterpriseRedirectModuleFrontController->postProcess()
#8 /public_html/classes/Dispatcher.php(525): ControllerCore->run()
#9 /public_html/index.php(28): DispatcherCore->dispatch()
#10 {main}

When enabling debug mode, we get more information about the origin of the problem:

2023/12/07 - 15:41:38: HipayLogs:logException:Warning: Division by zero
2023/12/07 - 15:41:38: HipayLogs:logException:#0 /public_html/modules/hipay_enterprise/classes/apiFormatter/Cart/CartFormatter.php(76): CartFormatter->getFeesItem(Array)
#1 /public_html/modules/hipay_enterprise/classes/apiFormatter/Cart/CartFormatter.php(43): CartFormatter->mapRequest(Object(HiPay\Fullservice\Gateway\Model\Cart\Cart))
#2 /public_html/modules/hipay_enterprise/classes/apiHandler/ApiHandler.php(360): CartFormatter->generate()
#3 /public_html/modules/hipay_enterprise/classes/apiHandler/ApiHandler.php(339): Apihandler->getCart(Object(CartFormatter))
#4 /public_html/modules/hipay_enterprise/classes/apiHandler/ApiHandler.php(96): Apihandler->baseParamsInit(Array)
#5 /public_html/modules/hipay_enterprise/controllers/front/redirect.php(310): Apihandler->handleCreditCard('direct_post', Array)
#6 /public_html/modules/hipay_enterprise/controllers/front/redirect.php(127): Hipay_enterpriseRedirectModuleFrontController->apiNewCC(Object(Cart), Object(Context), Object(Customer), false, false)
#7 /public_html/classes/controller/Controller.php(295): Hipay_enterpriseRedirectModuleFrontController->postProcess()
#8 /public_html/classes/Dispatcher.php(525): ControllerCore->run()
#9 /public_html/index.php(28): DispatcherCore->dispatch()
#10 {main}

Environment Information:

Module Version: v2.20.0
PrestaShop Version: 1.7.8.10
PHP Version: 7.4.33

Installation sur Prestashop 1.6.1.23

Bonjour,

nous rencontrons des soucis lors de l'installation de votre module sur notre plateforme Prestashop
Test avec les versions 2.13.7 et 2.13.8

  • Lors de l'installation via le gestionnaire de modules :
  • erreur 500
  • Lors de l'upload direct du dossier dans le répertoire /modules de notre serveur :
  • Après passage récursif des fichiers et dossiers en 766 : le module n'apparait pas dans le gestionnaire de modules
  • Après test et passage récursif des fichiers et dossiers en 775 : erreur 500 sur la page du gestionnaire de modules

Avez-vous des pistes à nous fournir (config serveur spécifique, version de module non compatible avec notre version de Prestashop, etc....)

Boutique concernée : https://boutique.lemans.org/

Merci à vous,

Error on displayAdminOrder hook

Module v2.17.2 for PrestaShop 1.7.5.5 in PHP 7.2.

When I have an order with only one virtual product, the hookDisplayAdminOrder causes an error:

image

Following the stackTrace, I realize that the problematic line comes from a DiplayPrice in the smarty file "refund.partial.tpl". After a test, it is line 108, "{displayPrice price=$amountFees currency=$id_currency}".
So I tested to display the content of amountFees and we can see that "$this->order->getShipping()" returns a data, but with most of the values at "NULL" :

image

And so the displayPrice is done on "NULL" and generates an error.

The fact that there is no row created in the "ps_order_carrier" table (virtual product). If we look at the "getShipping" function which is a function of the Order class of Prestashop :

image

We see that most of the fields are precisely defined by OC (ps_order_carrier) and C (ps_carrier), and since the query starts from ps_order (which is defined) and the rest of the query uses LEFT JOIN, we will automatically have an array with the keys whose values will be mostly NULL.

Personally, I made a quickfix that fixes my problem, I can always make a pull request to manage this problem.

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.