Jump to content

Problème De Validation De Paiement E Transaction


Recommended Posts

Bonjour, j'utilise actuellement le module E Transaction pour le paiement en ligne par carte, cependant je rencontre un soucis : après avoir choisi ma méthode de paiement, rentré mes identifiants (numéro de carte etc), le paiement s'effectue comme prévu, cependant la commande n'est pas envoyée.

Le problème vient du controller : 

 if ($params !== false) {
                $cart = $this->getHelper()->untokenizeCart($params['reference']);
                $orderId = (int)Order::getOrderByCartId((int)$cart->id);
               if (($orderId === false) || ($this->getHelper()->getOrderDetails($orderId) === false)) {					
                    if ($loop < 10) {
                        $url = '?' . $_SERVER['QUERY_STRING'] . '&loop=' . ($loop + 1);
                        ?>
                        <!doctype html>
                        <html>
                            <head>
                                <meta http-equiv="refresh" content="1;url=<?php echo htmlentities($url); ?>"/>
                            </head>
                            <body>
                                <?php echo $this->l('Please wait while validating the order...'); ?>
                            </body>
                        </html>
                        <?php
                        $message = sprintf('Cart %d: Customer is back from E-Transactions payment page. Waiting order validation (loop %d).', $cart->id, $loop);
                        $this->logWarning($message);
                        die();
                    } else {
                        $message = sprintf('Cart %d: Customer is back from E-Transactions payment page. Order not validated.', $cart->id);
                        $this->logFatal($message);
                        $this->_redirectToCart();
                    }
                }

En effet après vérification, la variable "$orderId" est à 0, quelqu'un aurait une idée de pourquoi Order::getOrderByCartId() me renvoie false ?
Merci d'avance, Silveris.

EDIT : Après avoir trouvé la fonction getOrderByCardId, la voici :
 

public static function getOrderByCartId($id_cart)
    {
        $sql = 'SELECT `id_order`
				FROM `'._DB_PREFIX_.'orders`
				WHERE `id_cart` = '.(int)$id_cart
                    .Shop::addSqlRestriction();
        $result = Db::getInstance()->getRow($sql);

        return isset($result['id_order']) ? $result['id_order'] : false;
    }

La commande avec l'id passé en paramètre ne se trouverait donc pas dans la BDD ? Une idée de pourquoi ?

Edited by Silveris (see edit history)
Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...