Example #1
0
                 }
             }
             if (is_discountable(calculate_total()) != 0 && !isset($vset)) {
                 $discount = is_discountable(calculate_total()) / 100;
                 $value = number_format(round($value - $value * $discount, 2), 2);
             }
         }
         if (sizeof($stateList) > 0 && ($name == 'state' || $name == 'ship_state')) {
             if ($value != '') {
                 $value = $eshopstatelist[$value];
             }
         }
         $p->add_field($name, $value);
     }
     if ($eshopoptions['status'] != 'live' && is_user_logged_in() && current_user_can('eShop_admin') || $eshopoptions['status'] == 'live') {
         $echoit .= $p->submit_ideallite_post();
         // submit the fields to ideallite
         //$p->dump_fields();      // for debugging, output a table of all the fields
     }
     break;
 case 'idealliteipn':
     // ideallite is calling page for IPN validation...
     // It's important to remember that ideallite calling this script.  There
     // is no output here.  This is where you validate the IPN data and if it's
     // valid, update your database to signify that the user has payed.  If
     // you try and use an echo or printf function here it's not going to do you
     // a bit of good.  This is on the "backend".  That is why, by default, the
     // class logs all IPN data to a text file.
     // the loggin to a text file isn't working, so we have coded an email to be sent instead.
     // Payment has been received and IPN is verified.  This is where you
     // update your database to activate or process the order, or setup