/*****************************************************************************\ +-----------------------------------------------------------------------------+ | X-Cart | | Copyright (c) 2001-2002 Ruslan R. Fazliev. All rights reserved. | +-----------------------------------------------------------------------------+ | The Ruslan R. Fazliev forbids, under any circumstances, the unauthorized | | reproduction of software or use of illegally obtained software. Making | | illegal copies of software is prohibited. Individuals who violate copyright | | law and software licensing agreements may be subject to criminal or civil | | action by the owner of the copyright. | | | | 1. It is illegal to copy a software, and install that single program for | | simultaneous use on multiple machines. | | | | 2. Unauthorized copies of software may not be used in any way. This applies | | even though you yourself may not have made the illegal copy. | | | | 3. Purchase of the appropriate number of copies of a software is necessary | | for maintaining legal status. | | | | DISCLAIMER | | | | THIS SOFTWARE IS PROVIDED BY Ruslan R. Fazliev ``AS IS'' AND ANY | | EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | | DISCLAIMED. IN NO EVENT SHALL Ruslan R. Fazliev OR ITS | | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | | | The Initial Developer of the Original Code is Ruslan R. Fazliev. | | Portions created by Ruslan R. Fazliev are Copyright (C) 2001-2002 | | Ruslan R. Fazliev. All Rights Reserved. | +-----------------------------------------------------------------------------+ \*****************************************************************************/ # # $Id: cc_usaepay.php,v 1.3 2002/12/05 12:30:19 sdg Exp $ # set_time_limit(100); # # Based on cc_plugnpaycom.php # $pp_merch = $module_params["param01"]; $pp_auth = $module_params["param02"]; $pp_test = $module_params["param03"]; if(!file_exists("./usaepay.pl")) { header("Location: ../customer/error_message.php?error_ccprocessor_notfound"); exit; } $post[] = "UMkey=".$pp_merch; if($pp_test=="test") $post[] = "UMtestmode=1"; $post[] = "UMip=".$REMOTE_ADDR; $post[] = "UMinvoice=".func_get_urlencoded_orderids($secure_oid);; $post[] = "UMname=".$userinfo["firstname"]." ".$userinfo["lastname"]; $post[] = "UMstreet=".$userinfo["b_address"]; $post[] = "UMzip=".$userinfo["b_zipcode"]; $post[] = "UMbillname=".$userinfo["firstname"]." ".$userinfo["lastname"]; $post[] = "UMbillcompany=".$userinfo["company"]; $post[] = "UMbillstreet=".$userinfo["b_address"]; $post[] = "UMbillcity=".$userinfo["b_city"]; $post[] = "UMbillstate=".$userinfo["b_state"]; $post[] = "UMbillzip=".$userinfo["b_zipcode"]; $post[] = "UMbillcountry=".$userinfo["b_country"]; $post[] = "UMbillphone=".$userinfo["phone"]; $post[] = "UMbillemail=".$userinfo["email"]; $post[] = "UMamount=".$cart["total_cost"]; $post[] = "UMcard=".$userinfo["card_number"]; $post[] = "UMexpir=".$userinfo["card_expire"]; $post[] = "UMcvv2=".$userinfo["card_cvv2"]; $post[] = "UMshipstreet=".$userinfo["s_address"]; $post[] = "UMshipcity=".$userinfo["s_city"]; $post[] = "UMshipcountry=".$userinfo["b_country"]; $post[] = "UMshipfname=".$userinfo["firstname"]; $post[] = "UMshiplname=".$userinfo["lastname"]; $post[] = "UMshipphone=".$userinfo["phone"]; $post[] = "UMshipzip=".$userinfo["s_zipcode"]; $post[] = "UMshipstate=".$userinfo["s_state"]; # # Execute perl script # foreach($post as $k => $v) { list($a,$b)=split("=",$v); $post[$k] = $a."=".urlencode($b);} exec ("./usaepay.pl ".join("\&",$post)." 2>&1", $bill_output); list($bill_errorcode,$bill_message) = explode(",",$bill_output[0],2); if ($bill_errorcode == 2) $bill_error="error_ccprocessor_error"; elseif ($bill_errorcode != 1) $bill_error="error_ccprocessor_unavailable"; $bill_message="