Example #1
0
 foreach ($_GET as $key => $value) {
     if (strtoupper($key) != 'SHASIGN' and $value != '' and !in_array($key, $ignoreKeyList)) {
         $ogoneParams[strtoupper($key)] = $value;
     }
 }
 ksort($ogoneParams);
 $shasign = '';
 foreach ($ogoneParams as $key => $value) {
     $shasign .= strtoupper($key) . '=' . $value . Configuration::get('OGONE_SHA_OUT');
 }
 $sha1 = strtoupper(sha1($shasign));
 if ($sha1 == $_GET['SHASIGN']) {
     switch ($_GET['STATUS']) {
         case 1:
             /* Real error or payment canceled */
             $ogone->validate((int) $_GET['orderID'], _PS_OS_ERROR_, 0, $_GET['NCERROR'] . $params, $_GET['secure_key']);
             break;
         case 2:
             /* Real error - authorization refused */
             $ogone->validate((int) $_GET['orderID'], _PS_OS_ERROR_, 0, $ogone->l('Error (auth. refused)') . '<br />' . $_GET['NCERROR'] . $params, $_GET['secure_key']);
             break;
         case 5:
         case 9:
             /* Payment OK */
             $ogone->validate((int) $_GET['orderID'], _PS_OS_PAYMENT_, (double) $_GET['amount'], $ogone->l('Payment authorized / OK') . $params, $_GET['secure_key']);
             break;
         case 6:
         case 7:
         case 8:
             // Payment canceled later
             if ($id_order = (int) Order::getOrderByCartId((int) $_GET['orderID'])) {
Example #2
0
 foreach ($_GET as $key => $value) {
     if (strtoupper($key) != 'SHASIGN' && $value != '' && !in_array($key, $ignoreKeyList)) {
         $ogoneParams[strtoupper($key)] = $value;
     }
 }
 ksort($ogoneParams);
 $shasign = '';
 foreach ($ogoneParams as $key => $value) {
     $shasign .= strtoupper($key) . '=' . $value . Configuration::get('OGONE_SHA_OUT');
 }
 $sha1 = strtoupper(sha1($shasign));
 if ($sha1 == $_GET['SHASIGN']) {
     switch ($_GET['STATUS']) {
         case 1:
             /* Real error or payment canceled */
             $ogone->validate((int) $_GET['orderID'], Configuration::get('PS_OS_ERROR'), 0, Tools::safeOutput($_GET['NCERROR']) . $params, Tools::safeOutput($_GET['secure_key']));
             break;
         case 2:
             /* Real error - authorization refused */
             $ogone->validate((int) $_GET['orderID'], Configuration::get('PS_OS_ERROR'), 0, $ogone->l('Error (auth. refused)') . '<br />' . Tools::safeOutput($_GET['NCERROR']) . $params, Tools::safeOutput($_GET['secure_key']));
             break;
         case 5:
         case 9:
             /* Payment OK */
             $ogone->validate((int) $_GET['orderID'], Configuration::get('PS_OS_PAYMENT'), (double) $_GET['amount'], $ogone->l('Payment authorized / OK') . $params, Tools::safeOutput($_GET['secure_key']));
             break;
         case 6:
         case 7:
         case 8:
             // Payment canceled later
             if ($id_order = (int) Order::getOrderByCartId((int) $_GET['orderID'])) {