Might have to do it in this file.. This is a "payment.pm" file:
If you want a zip copy of both files.. Go to
http://www.onlinegameaddicts.com/payment.zip
Also.. If you are able to convert it for the 2checkout option as well, I'll make it $35.00... I know someone out there could do this for me in about 10 minutes flat.. lol
------------------------
package payment;
use strict;
sub add_order
{
my($dbh,$total,$cart_order_id,$deposit_type,$time,$status,$custid)=@_;
my $sth=$dbh->prepare("INSERT INTO ad_order(total,cart_order_id,deposit_type,time,status,custid,date_added) VALUES(?,?,?,?,?,?,NOW())");
$sth->execute($total,$cart_order_id,$deposit_type,$time,$status,$custid);
my $id=$sth->{'mysql_insertid'};
return $id;
}
sub update_order
{
my($dbh,$id,$order_number,$cart_order_id,$status)=@_;
my $sth=$dbh->prepare("UPDATE ad_order SET order_number=?,status=? WHERE cart_order_id=? AND id=?");
$sth->execute($order_number,$status,$cart_order_id,$id);
$sth=$dbh->prepare("SELECT custid FROM ad_order WHERE order_number=? AND cart_order_id=?");$sth->execute($order_number,$cart_order_id);
my($custid)=$sth->fetchrow_array;
return $custid;
}
sub check_order
{
my($dbh,$cart_order_id)=@_;
my $sth=$dbh->prepare("SELECT id,total FROM ad_order WHERE cart_order_id=? AND status<>1");$sth->execute($cart_order_id);
my($id,$total)=$sth->fetchrow_array;
return($id,$total);
}
sub order_done
{
my($dbh,$total,$custid)=@_;
my $sth=$dbh->prepare("UPDATE ad_client SET balance=balance+? WHERE id=?");
$sth->execute($total,$custid);
return 1;
}
sub transaction
{
my($dbh,$total,$custid,$deposit_type,$script_url)=@_;
my $ext_file=$dblib::ext_file;
my $server_url=$dblib::server_url;
my $payment_url=$server_url."/".$script_url."/";
$payment_url=~s/\/\//\//g;
$payment_url=~s/http:\//http:\/\//;
if(($total<=0) || !($deposit_type==1 || $deposit_type==2 || $deposit_type==3 || $deposit_type==4 || $deposit_type==5 || $deposit_type==6 || $deposit_type==7)){return(0,"Incomplete Information");}
my $time=time();
my $sth=$dbh->prepare("SELECT account,active,links FROM ad_deposit_type WHERE id=?");$sth->execute($deposit_type);my($account,$active,$links)=$sth->fetchrow_array;
if($active && $deposit_type==3)
{
add_order($dbh,$total,$time,$deposit_type,$time,0,$custid);
print "Location: https://www.2checkout.com/cgi-bin/sbuyers/cartpurchase.2c?demo=N&sid=$account&total=$total&cart_order_id=$time\n\n";
exit;
}
elsif($active && $deposit_type==1)
{
add_order($dbh,$total,$time,$deposit_type,$time,0,$custid);
my $return=$payment_url."ret_paypal.$ext_file";
$return=~s/\:/\%3A/g;
$return=~s/\./\%2E/g;
$return=~s/\//\%2F/g;
print "Location: https://www.paypal.com/cgi-bin/webscr?business=$account&cmd=_xclick&cancel_return=http%3A%2F%2Fwww%2Epaypal%2Ecom&return=$return%3F $time-$custid&item_name=Deposit&item_number=1&invoice=PP$time&amount=$total&no_shipping=1\n\n";
exit;
}
elsif($active && $deposit_type==4)
{
add_order($dbh,$total,$time,$deposit_type,$time,0,$custid);
my $hpage=$payment_url."client.$ext_file";$hpage=~s/\:/\%3A/g;$hpage=~s/\./\%2E/g;$hpage=~s/\//\%2F/g;
my $return=$payment_url."ret_itransact.$ext_file?1_order_number=$time";$return=~s/\:/\%3A/g;$return=~s/\./\%2E/g;$return=~s/\//\%2F/g;
print "Location: https://secure.itransact.com/cgi-bin/buynow/buynow.cgi?showaddr=1&1-desc=Deposit&1-cost=$total&1-qty=1&vendor_id=$account&home_page=$hpage&ret_addr=$return&mername=Advertise+With+Pleasure&showcvv=1 &acceptcards=1&1_order_number=$time\n\n";
exit;
}
elsif($active && $deposit_type==5)
{
$links=~s/\r//gi;
my @links=split(/\n/g,$links);
my @amount_sel=();
foreach (@links)
{
my($sum,$url)=split(/\|/s,$_);
if($sum==$total)
{
add_order($dbh,$total,$time,$deposit_type,$time,0,$custid);
$url=$url."&s=".$time."&total=".$total;
print "Location: $url\n\n";
exit;
}
}
}
elsif($active && $deposit_type==6)
{
add_order($dbh,$total,$time,$deposit_type,$time,0,$custid);
my $return=$payment_url."ret_egold.$ext_file";
$return=~s/\/\//\//g;$return=~s/http:\//http:\/\//;
$return=~s/\:/\%3A/g;$return=~s/\./\%2E/g;$return=~s/\//\%2F/g;
my $return_bad=$payment_url."client.$ext_file";
$return_bad=~s/\/\//\//g;$return_bad=~s/http:\//http:\/\//;
$return_bad=~s/\:/\%3A/g;$return_bad=~s/\./\%2E/g;$return_bad=~s/\//\%2F/g;
print "Location: https://www.e-gold.com/sci_asp/payments.asp?PAYEE_ACCOUNT=$account&PAYMENT_AMOUNT=$total&PAYMENT_ID=$time&PAYMENT_URL=$return&NOPAY MENT_URL=$return_bad&PAYEE_NAME=Fillup%20Balane&PAYMENT_UNITS=1&PAYMENT_METAL_ID=1&PAYMENT_URL_METHO D=POST&SUGGESTED_MEMO=Fillup%20personal%20balance&NOPAYMENT_URL_METHOD=POST&BAGGAGE_FIELDS=op_key&op _key=$custid\n\n";
exit;
}
elsif($active && $deposit_type==7)
{
add_order($dbh,$total,$time,$deposit_type,$time,0,$custid);
my $return=$payment_url."ret_paysystems.$ext_file?o=$time";
$return=~s/\/\//\//g;$return=~s/http:\//http:\/\//;
$return=~s/\:/\%3A/g;$return=~s/\./\%2E/g;$return=~s/\//\%2F/g;
my $return_bad=$payment_url."client.$ext_file";
$return_bad=~s/\/\//\//g;$return_bad=~s/http:\//http:\/\//;
$return_bad=~s/\:/\%3A/g;$return_bad=~s/\./\%2E/g;$return_bad=~s/\//\%2F/g;
print "Location: https://secure.paysystems1.com/cgi-v310/payment/onlinesale-tpppro.asp?companyid=$account&product1=Deposit&total=$total&formget=N&redirect=$return&redirectfail= $return_bad&\n\n";
exit;
}
return(1,"");
}
sub Process_AuthroizeNet
{
my($authorize_net_login,$amount,%Customer)=@_;
my($Fields,$Domain,$Sub_Domain);
my(@Response,$Response);
my(%AVS)=("A"=>"Address (Street) matches, ZIP does not","B"=>"Address Information Not Provided for AVS Check","E"=>"AVS error","G"=>"Non U.S. Card Issuing Bank","N"=>"No Match on Address (Street) or ZIP","P"=>"AVS not applicable for this transaction","R"=>"Retry – System unavailable or timed out","S"=>"Service not supported by issuer","U"=>"Address information is unavailable","W"=>"9 digit ZIP matches, Address (Street) does not","X"=>"Address (Street) and 9 digit ZIP match","Y"=>"Address (Street) and 5 digit ZIP match","Z"=>"5 digit ZIP matches, Address (Street) does not");
$Fields ="x_ADC_URL=FALSE&";
$Fields.="x_Version=3.10&";
$Fields.="x_ADC_Delim_Data=TRUE&";
$Fields.="x_Card_Num=$Customer{'Card_Num'}&";
$Fields.="x_Exp_Date=$Customer{'Card_Expires'}&";
$Fields.="x_Card_Code=$Customer{'Card_Code'}&";
$Fields.="x_Login=$authorize_net_login&";
$Fields.="x_Amount=$amount&";
$Fields.="x_Method=CC&";
$Fields.="x_Type=auth_capture&";
$Fields.="x_First_Name=$Customer{'First_Name'}&" if ($Customer{'First_Name'});
$Fields.="x_Last_Name=$Customer{'Last_Name'}&" if ($Customer{'Last_Name'});
$Fields.="x_Address=$Customer{'Street_Address'}&" if ($Customer{'Street_Address'});
$Fields.="x_City=$Customer{'City'}&" if ($Customer{'City'});
$Fields.="x_State=$Customer{'State'}&" if ($Customer{'State'});
$Fields.="x_Zip=$Customer{'Zip'}&" if ($Customer{'Zip'});
$Fields.="x_Country=$Customer{'Country'}&" if ($Customer{'Country'});
$Fields.="x_Company=$Customer{'Company'}&" if ($Customer{'Company'});
$Fields.="x_Ship_To_First_Name=$Customer{'s_First_Name'}&" if ($Customer{'s_First_Name'});
$Fields.="x_Ship_To_Last_Name=$Customer{'s_Last_Name'}&" if ($Customer{'s_Last_Name'});
$Fields.="x_Ship_To_Address=$Customer{'s_Street_Address'}&" if ($Customer{'s_Street_Address'});
$Fields.="x_Ship_To_City=$Customer{'s_City'}&" if ($Customer{'s_City'});
$Fields.="x_Ship_To_State=$Customer{'s_State'}&" if ($Customer{'s_State'});
$Fields.="x_Ship_To_Zip=$Customer{'s_Zip'}&" if ($Customer{'s_Zip'});
$Fields.="x_Ship_To_Country=$Customer{'s_Country'}&" if ($Customer{'s_Country'});
$Fields.="x_Ship_To_Company=$Customer{'s_Company'}&" if ($Customer{'s_Company'});
$Fields.="x_Phone=$Customer{'Phone'}&" if ($Customer{'Phone'});
$Fields.="x_Fax=$Customer{'Fax'}&" if ($Customer{'Fax'});
$Fields.="x_Email=$Customer{'Email'}&" if ($Customer{'Email'});
$Fields.="x_Invoice_Num=$Customer{'Invoice_Num'}&" if ($Customer{'Invoice_Num'});
$Fields.="x_Test_Request=FALSE";
$Fields=~s/ /%20/g;
$Domain="secure.authorize.net";
$Sub_Domain="/gateway/transact.dll";
$Response=&Web_Server($Domain,$Sub_Domain,$Fields);
@Response=split(",",$Response);
if($Response[0]==1)
{
return(1,$Response[3],$AVS{$Response[5]},$Response[4],$Response[6]);
}
else
{
return(0,$Response[3],"@Response", "", "");
}
}
sub SSL_Post
{
my($Domain,$URL,$Form_Param,$type)=@_;
my($buf);
my $testresult=eval("use Net::SSL");
if($@){warn "couldn't load Net::SSL: $@";}
my $remote=Net::SSL->new(PeerAddr=>$Domain,PeerPort=>443) or print "Can't connect";
print "ERROR" if !$remote;
$remote->autoflush(1);
if($type){$remote->print("POST $URL HTTP/1.0\nHost: $Domain\n\n");}
else{$remote->print("GET $URL HTTP/1.0\nHost: $Domain\n\n");}
my $reply='';
while($remote->read($buf,1024)){$reply.=$buf;}
close $remote;
my($Header,$Response)=split("\r\n\r\n",$reply);
return $Response;
}
sub Web_Server
{
my($Domain,$URL,$Form_Param)=@_;
my($Full_URL,$Response,$Code,$Status,$Header);
if(!$Form_Param){$Full_URL=$Domain.$URL;}
else{$Full_URL=$URL."?".$Form_Param;}
$Response=&SSL_Post($Domain,$Full_URL,$Form_Param);
return $Response;
}
1;