#!/usr/bin/perl ############################################################################### # # # 4/04/2008 - Created for gotacres.com for auction check-out after winning # # use CGI; use CGI::Carp qw/fatalsToBrowser/; $cgi = new CGI; use DBI; $User_name = $cgi->param('User_name'); $User_email = $cgi->param('User_email'); $Auction_id = $cgi->param('Auction_id'); #$Auction_id='88'; $This_action = $cgi->param('This_action'); $APIcall = $cgi->param('call'); if ($APIcall ne ""){ &DOAPICALL; exit; } if ($This_action eq "" && $User_name eq "" || $This_action eq "" && $Auction_id eq ""){ &DONOTENOUGHINFOERROR; exit; } elsif ($This_action eq "") { print "Content-type: text/html\n\n"; open (HEAD, "gothead.pp"); until (eof (HEAD)){ $Head = ; chop $Head; print "$Head\n"; } close HEAD; print "
\n"; print "
You've got land!

Enter your auction password to retrieve the details of your winning auction(s)!

\n"; print "

\n"; print "
Auction Username
Password


\n"; open (FOOT, "gotfoot.pp"); until (eof (FOOT)){ $Head = ; chop $Head; print "$Head\n"; } close FOOT; exit; } elsif ($This_action eq "Process_step_one"){ $woncount = $cgi->param('woncount'); my $Sql_cookie = $cgi->cookie('gotacres.compp'); my @cookied = split (/\:/ , $Sql_cookie); $User_id = $cookied[0]; $Auction_id = $cookied[1]; if ($User_id eq "" || $Auction_id eq ""){ # # Tell them paypal requires it for security # # &DONOCOOKIEERROR; # exit; } #&GETEXPRESSCONFIG; if ($woncount eq ""){ $Title_name[1] = $cgi->param('Title_name1'); $Addressa[1] = $cgi->param('Addressa1'); $Addressa[2] = $cgi->param('Addressb2'); $City[1] = $cgi->param('City1'); $State[1] = $cgi->param('State1'); $Zip_postal[1] = $cgi->param('Zip_postal1'); $Country[1] = $cgi->param('Country1'); $Contact_email[1] = $cgi->param('Contact_email1'); $Check_amount[1] = $cgi->param('Check_amount1'); $Auction_id[1] = $cgi->param('Auction_id1'); $Title[1] = $cgi->param('Title1'); $User_name = $cgi->param('username'); $Referred_by_other = $cgi->param('Referred_by_other'); $Referred_by = $cgi->param('Referred_by'); $Contact_phone[1] = $cgi->param('Contact_phone1'); require "../../got_data/gotacresql.pl"; &SQLVAR; $dbh = DBI->connect("DBI:mysql:database=$db_name;host=$db_host", $db_user, $db_pass, {'RaiseError' => 1}); $sth = $dbh->prepare("SELECT * FROM geodesic_auctions_logins WHERE username='$User_name'"); $sth->execute(); $ref = $sth->fetchrow_hashref; $Onfile_pass = $ref->{'password'}; $User_id = $ref->{'id'}; $Auction_pass = $cgi->param('Auction_pass'); $User_id = $ref->{'id'}; $Payment_type = $cgi->param('Payment_type'); $ECAmt = "199.00"; if ($Payment_type eq "Both" || $Payment_type eq ""){ $sth = $dbh->prepare("SELECT * FROM geodesic_auctions_bids WHERE auction_id='$Auction_id[1]' AND bidder='$User_id' ORDER BY bid DESC"); $sth->execute(); $ref = $sth->fetchrow_hashref; $Amount_bid_due = $ref->{'bid'}; $ECAmt = $ECAmt+$Amount_bid_due; if ($ECAmt ne "199.00"){ $ECAmt .= ".00"; } } $replaceboth = $ECAmt; if (uc($Onfile_pass) ne uc($Auction_pass)){ $Error = "
  1. Password entered did not match auction password!"; $errcnt++; } if ($Title_name[1] eq ""){ if ($Error eq ""){ $Error = "
      "; } $Error .= "
    1. You must include the legal name of the person to whom the title will be issued!"; $errcnt++; } if ($Addressa[1] eq ""){ if ($Error eq ""){ $Error = "
        "; } $Error .= "
      1. You must include the address to which we will send the documents!"; $errcnt++; } if ($City[1] eq ""){ if ($Error eq ""){ $Error = "
          "; } $Error .= "
        1. You must include the city to which we will send the documents!"; $errcnt++; } if ($Zip_postal[1] eq ""){ if ($Error eq ""){ $Error = "
            "; } $Error .= "
          1. You must include the Zip or Postal Code to which we will send the documents! (If none, enter None)"; $errcnt++; } if ($Country[1] eq ""){ if ($Error eq ""){ $Error = "
              "; } $Error .= "
            1. You must include the country to which we will send the documents!"; $errcnt++; } if ($Contact_email[1] eq ""){ if ($Error eq ""){ $Error = "
                "; } $Error .= "
              1. You must include an email address!"; $errcnt++; } if ($Contact_phone[1] eq ""){ if ($Error eq ""){ $Error = "
                  "; } $Error .= "
                1. You didn't enter your phone number!"; $errcnt++; } if ($Referred_by eq "Click to select."){ if ($Error eq ""){ $Error = "
                    "; } $Error .= "
                  1. You didn't select anything for how you found us!"; $errcnt++; } if ($Payment_type eq ""){ if ($Error eq ""){ $Error = "
                      "; } $Error .= "
                    1. You didn't choose to pay either the document fee or the document fee and your winning bid!"; $errcnt++; } #$Error=""; if ($Error ne ""){ $Error .= "
                    "; &DOCHECKOUTERROR; exit; } else { # http://www.gotacres.com/NVP/nvp.cgi?UseSandbox=Y&call=SetExpressCheckout # ======================= # SET EXPRESS CHECKOUT # ======================== # example URL to call this API # http://HOST/cgi-bin/poneal/NVP_perl/nvp.cgi?UseSandbox=Y&call=SetExpressCheckout #$APIrequest = uri_escape("&METHOD=SetExpressCheckout&RETURNURL=".$ECRetUrl."&CANCELURL=".$ECCanclRetUrl."&AMT=".$ECAmt."&CURRENCYCODE=USD&PAYMENTACTION=Authorization"); $APIcall = "SetExpressCheckout"; &GETEXPRESSCONFIG; #$ECAmt = "1.00"; $APIrequest = "&METHOD=SetExpressCheckout&RETURNURL=".$ECRetURL ."&CANCELURL=".$ECCanclRetUrl."&AMT=".$ECAmt."&CURRENCYCODE=USD&PAYMENTACTION=Authorization"; #$APIrequest = "&METHOD=SetExpressCheckout&RETURNURL=".$ECRetURL ."&CANCELURL=".$ECCanclRetUrl."&AMT=".$ECAmt."&CURRENCYCODE=USD&PAYMENTACTION=Authorization&DESC=$My_desc&HDRBORDERCOLOR=$headerborder&HDRIMG=$headerimage&HDRBACKCOLOR=$headerbackcolor"; #$APIrequest2 = "&METHOD=SetExpressCheckout&RETURNURL=".$ECRetURL ."&CANCELURL=".$ECCanclRetUrl."&AMT=".$ECAmt1."&CURRENCYCODE=USD&PAYMENTACTION=Authorization"; #$paypalbutton1 = #die; &GETAPIDETAILS; $This_pp = " https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=".$ECToken.""; open (CHEC, "checkout_template1_newpp"); my $Thissession = "$User_id\:$Auction_id[1]"; push @cookies, $cgi->cookie(-name=>'gotacres.compp', -value=>($Thissession), -expires=>'+1h'); print $cgi->header(-cookie=>[@cookies]); $ECAmt .= ".00"; if ($Payment_type eq "Both"){ $Replace_checkout_type = "both the document fee and the winning bid (\$$ECAmt).

                    \n"; } else { $Replace_checkout_type = "just the document fee (\$199.00) and will return a check or money order for your winning bid with your signed documents.

                    \n"; } $tempfile = "$User_id"."$Auction_id[1]"."temp.txt"; open (TEMP, ">temp/$tempfile"); print TEMP "$Title_name[1]\\$Addressa[1]\\$Addressa[2]\\$City[1]\\$State[1]\\$Zip_postal[1]\\$Country[1]\\$Contact_email[1]\\$Check_amount[1]\\$Auction_id[1]\\$Title[1]\\$ECAmt\\n"; close TEMP; #$Auction_id .= ""; until (eof (CHEC)){ $Chec = ; chop $Chec; $Chec =~ s/REPLACEAUCTIONID/$Auction_id[1] /g; $Chec =~ s/MIKEREPUSER/\/g; $Chec =~ s/REPLACEAUCTIONTITLE/$Title[1]/g; $Chec =~ s/REPLACETITLENAME/$Title_name[1]/g; $Chec =~ s/REPLACEADDRESS1/$Addressa[1]/g; $Chec =~ s/REPLACEADDRESS2/$Addressb[1]/g; $Chec =~ s/REPLACECITY/$City[1]/g; $Chec =~ s/REPLACESTATE/$State[1]/g; $Chec =~ s/REPLACEZIP/$Zip_postal[1]/g; $Chec =~ s/REPLACECOUNTRY/$Country[1]/g; $Chec =~ s/REPLACEEMAIL/$Contact_email[1]/g; $Chec =~ s/REPLACEPHONE/$Contact_phone[1]/g; $Chec =~ s/REPLACECHECKAMOUNT/$Check_amount[1]/g; $Chec =~ s/REPLACEREFERREDBYOTHER/$Referred_by_other/g; $Chec =~ s/REPLACEREFERREDBY/$Referred_by/g; $Chec =~ s/REPLACECHECKOUTTYPE/$Replace_checkout_type/; #$Chec =~ s/auctioncheckout\.cgi/auctioncheckoutpp\.cgi/g; #$Chec =~ s/PPBUTTON1/ #$Chec =~ s/PPBUTTON1/ print "$Chec\n"; } close CHEC; } } else { srand; # seed the random number function $num = int (rand 1000000); $thisfile = "$num".".pl"; $User_name = $cgi->param('username'); $Referred_by_other = $cgi->param('Referred_by_other'); $Referred_by = $cgi->param('Referred_by'); $One_for_all = $cgi->param('One_for_all'); require "../../got_data/gotacresql.pl"; &SQLVAR; $dbh = DBI->connect("DBI:mysql:database=$db_name;host=$db_host", $db_user, $db_pass, {'RaiseError' => 1}); $sth = $dbh->prepare("SELECT * FROM geodesic_auctions_logins WHERE username='$User_name'"); $sth->execute(); $ref = $sth->fetchrow_hashref; $Onfile_pass = $ref->{'password'}; $Auction_pass = $cgi->param('Auction_pass'); $User_id = $ref->{'id'}; $sth = $dbh->prepare("SELECT * FROM geodesic_auctions_bids WHERE auction_id='$Auction_id[1]' AND bidder='$User_id' ORDER BY bid DESC"); $sth->execute(); $ref = $sth->fetchrow_hashref; $Amount_bid_due = $ref->{'bid'}; $Payment_type = $cgi->param('Payment_type'); open (TEMP, ">$thisfile"); print TEMP "sub GETVAR {\n"; $defined=0; until ($defined >= $woncount){ $defined++; print TEMP "\$Auction_id[$defined] = \$cgi->param('Auction_id$defined');\n"; print TEMP "\$Title[$defined] = \$cgi->param('Title$defined');\n"; print TEMP "\$Title_name[$defined] = \$cgi->param('Title_name$defined');\n"; print TEMP "\$Addressa[$defined] = \$cgi->param('Addressa$defined');\n"; print TEMP "\$Addressb[$defined] = \$cgi->param('Addressb$defined');\n"; print TEMP "\$City[$defined] = \$cgi->param('City$defined');\n"; print TEMP "\$State[$defined] = \$cgi->param('State$defined');\n"; print TEMP "\$Zip_postal[$defined] = \$cgi->param('Zip_postal$defined');\n"; print TEMP "\$Country[$defined] = \$cgi->param('Country$defined');\n"; print TEMP "\$Contact_email[$defined] = \$cgi->param('Contact_email$defined');\n"; print TEMP "\$Contact_phone[$defined] = \$cgi->param('Contact_phone$defined');\n"; print TEMP "\$Check_amount[$defined] = \$cgi->param('Check_amount$defined');\n"; print TEMP "\$Keep_parcel[$defined] = \$cgi->param('Keep_parcel$defined');\n"; } print TEMP "}\n"; print TEMP "1;\n"; close TEMP; require "$thisfile"; &GETVAR; system "rm $thisfile"; if (uc($Onfile_pass) ne uc($Auction_pass)){ $Error = "

                    1. Password entered did not match auction password!"; $errcnt++; } if ($Referred_by eq "Click to select."){ if ($Error eq ""){ $Error = "
                        "; } $Error .= "
                      1. You didn't select anything for how you found us!"; $errcnt++; } &CHEKONEFORERRORS; if ($Payment_type eq ""){ if ($Error eq ""){ $Error = "
                          "; } $Error .= "
                        1. You didn't choose to pay either the document fee or the document fee and your winning bid!"; $errcnt++; } if ($One_for_all eq "") { &CHECKMULTIPLEFORERRORS; } else { &GETMULTIPLEDATA; } $remvcnt=0; until ($remvcnt >= $woncount){ $remvcnt++; if ($Keep_parcel[$remvcnt] eq ""){ $One_kept = "Yes"; } } if ($One_kept ne "Yes"){ if ($Error eq ""){ $Error = "ol"; } $Error .= "
                        2. You clicked \"No\" for all the parcels. You must purchase at least one property to continue."; $errcnt++; } #$Error=""; if ($Error ne ""){ &DOMULTIPLEERROR; exit; } else { # http://www.gotacres.com/NVP/nvp.cgi?UseSandbox=Y&call=SetExpressCheckout # ======================= # SET EXPRESS CHECKOUT # ======================== # example URL to call this API # http://HOST/cgi-bin/poneal/NVP_perl/nvp.cgi?UseSandbox=Y&call=SetExpressCheckout #$APIrequest = uri_escape("&METHOD=SetExpressCheckout&RETURNURL=".$ECRetUrl."&CANCELURL=".$ECCanclRetUrl."&AMT=".$ECAmt."&CURRENCYCODE=USD&PAYMENTACTION=Authorization"); $APIcall = "SetExpressCheckout"; if ($Payment_type eq "Both"){ $ECAmt = $Multiple_amount_due; } else { $ECAmt = $All_doc_fees; } &GETEXPRESSCONFIG; $APIrequest = "&METHOD=SetExpressCheckout&RETURNURL=".$ECRetURL ."&CANCELURL=".$ECCanclRetUrl."&AMT=".$ECAmt."&CURRENCYCODE=USD&PAYMENTACTION=Authorization"; #$APIrequest2 = "&METHOD=SetExpressCheckout&RETURNURL=".$ECRetURL ."&CANCELURL=".$ECCanclRetUrl."&AMT=".$ECAmt1."&CURRENCYCODE=USD&PAYMENTACTION=Authorization"; #$paypalbutton1 = &GETAPIDETAILS; my $Thissession = "$User_id\:$Auction_id[1]"; push @cookies, $cgi->cookie(-name=>'gotacres.compp', -value=>($Thissession), -expires=>'+1h'); print $cgi->header(-cookie=>[@cookies]); open (CHEC, "checkout_template_multiple1pp"); until (eof (CHEC)){ $Chec = ; chop $Chec; $Chec =~ s/REPLACEAUCTIONID/$Auction_id[1] $Amount_bid_due Bump/g; $Chec =~ s/MIKEREPUSER/\/g; $Chec =~ s/REPLACEAUCTIONTITLE/$Title[1]/g; $Chec =~ s/REPLACETITLENAME/$Title_name[1]/g; $Chec =~ s/REPLACEADDRESS1/$Addressa[1]/g; $Chec =~ s/REPLACEADDRESS2/$Addressb[1]/g; $Chec =~ s/REPLACECITY/$City[1]/g; $Chec =~ s/REPLACESTATE/$State[1]/g; $Chec =~ s/REPLACEZIP/$Zip_postal[1]/g; $Chec =~ s/REPLACECOUNTRY/$Country[1]/g; $Chec =~ s/REPLACEEMAIL/$Contact_email[1]/g; $Chec =~ s/REPLACEPHONE/$Contact_phone[1]/g; $Chec =~ s/REPLACECHECKAMOUNT/$Check_amount[1]/g; $Chec =~ s/REPLACEREFERREDBYOTHER/$Referred_by_other/g; $Chec =~ s/REPLACEREFERREDBY/$Referred_by/g; $Chec =~ s/REPLACEWONCOUNT/$woncount/g; #$Chec =~ s/auctioncheckout\.cgi/auctioncheckoutpp\.cgi/g; if ($Chec =~ /REPLACEOTHERAUCTIONS/){ $slip = 1; until ($slip >= $woncount){ $slip++; print "Auction # $Auction_id[$slip] for $Title[$slip]

                          \n"; print "

                          \n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
                          Precise name or names you want on title to the land:*$Title_name[$slip]
                          Address 1*$Addressa[$slip]
                          Address 2$Addressb[$slip]
                          City*$City[$slip]
                          State/Region*$State[$slip]
                          Zip/Postal Code*$Zip_postal[$slip]
                          Country*$Country[$slip]
                          Phone*$Contact_phone[$slip]
                          Email*$Contact_email[$slip]

                          \n"; } } else { print "$Chec\n"; } } } } } elsif ($This_action eq "Process_step_two"){ require "../../got_data/gotacresql.pl"; &SQLVAR; $dbh = DBI->connect("DBI:mysql:database=$db_name;host=$db_host", $db_user, $db_pass, {'RaiseError' => 1}); $User_name = $cgi->param('User_name'); $sth = $dbh->prepare("SELECT * FROM geodesic_auctions_userdata WHERE username='$User_name'"); $sth->execute(); $ref = $sth->fetchrow_hashref; $User_id = $ref->{'id'}; $Referred_by_other = $cgi->param('Referred_by_other'); $Referred_by = $cgi->param('Referred_by'); $Check_amount = $cgi->param('Check_amount'); $woncount = $cgi->param('woncount'); if ($woncount eq ""){ $woncount = 1; } srand; # seed the random number function $num = int (rand 1000000); $thisfile = "$num".".pl"; open (TEMP, ">$thisfile"); print TEMP "sub GETVAR {\n"; $defined=0; until ($defined >= $woncount){ $defined++; print TEMP "\$Auction_id[$defined] = \$cgi->param('Auction_id$defined');\n"; print TEMP "\$Title[$defined] = \$cgi->param('Title$defined');\n"; print TEMP "\$Title_name[$defined] = \$cgi->param('Title_name$defined');\n"; print TEMP "\$Addressa[$defined] = \$cgi->param('Addressa$defined');\n"; print TEMP "\$Addressb[$defined] = \$cgi->param('Addressb$defined');\n"; print TEMP "\$City[$defined] = \$cgi->param('City$defined');\n"; print TEMP "\$State[$defined] = \$cgi->param('State$defined');\n"; print TEMP "\$Zip_postal[$defined] = \$cgi->param('Zip_postal$defined');\n"; print TEMP "\$Country[$defined] = \$cgi->param('Country$defined');\n"; print TEMP "\$Contact_email[$defined] = \$cgi->param('Contact_email$defined');\n"; print TEMP "\$Contact_phone[$defined] = \$cgi->param('Contact_phone$defined');\n"; print TEMP "\$Check_amount[$defined] = \$cgi->param('Check_amount$defined');\n"; } print TEMP "}\n"; print TEMP "1;\n"; close TEMP; require "$thisfile"; &GETVAR; system "rm $thisfile"; $leglcnt = 0; until ($leglcnt >= $woncount){ $leglcnt++; $Where_this = "WHERE id = \"$Auction_id[$leglcnt]\" AND live='0'"; $sth = $dbh->prepare("SELECT * FROM geodesic_auctions $Where_this"); $sth->execute(); $ref = $sth->fetchrow_hashref; $This_seller[$leglcnt] = $ref->{'seller'}; $Mikes = $ref->{'description'}; $Mike_hash_in = $Mikes; &GETMIKEHASH; @descript = split (/\/ , $Mike_hash_in); $Legal = $descript[4]; $Legal =~ s/\//g; $Legal =~ s/\<\/STRONG\>//g; $Legal =~ s/\<\/P\>//g; $Legal =~ s/Legal: //g; $Legal =~ s/Legal://g; $Legal =~ s/\//gi; $Legal =~ s/\<\/u\>//gi; $Legal[$leglcnt] = $Legal; @sold1 = split (/Price:/ , $Mike_hash_in); @sold2 = split (/\)/ , $sold1[1]); $This_price = $sold2[0]; $This_price =~ s/\<\/u\>//ig; $This_price =~ s/\<\/strong\>//ig; $This_price .= ")"; $Sell_price[$leglcnt] = $This_price; $updateset = "high_bidder='$User_id'"; $sth = $dbh->prepare("UPDATE geodesic_auctions SET $updateset WHERE id = \"$Auction_id[$leglcnt]\" AND live='0'"); $sth->execute(); $sth = $dbh->prepare("SELECT * FROM geodesic_auctions_userdata WHERE id='$This_seller[$leglcnt]'"); $sth->execute(); $ref = $sth->fetchrow_hashref; $This_seller_name[$leglcnt] = "$ref->{'firstname'} $ref->{'lastname'}"; $This_seller_email[$leglcnt] = $ref->{'email'}; } if ($woncount ==1){ open (MAIL,"|/usr/sbin/sendmail -f $This_seller_email[1] $Contact_email[1]"); #open (MAIL,"|/usr/sbin/sendmail -f webmaster\@gotacres.com webmaster\@gotacres.com"); print MAIL "From: $This_seller_name[1] <$This_seller_email[1]>\n"; print MAIL "To: $Title_name[1] <$Contact_email[1]>\n"; print MAIL "Subject: Title details for $Legal[1]!\n\n"; print MAIL "Here are the title details for auction # $Auction_id[1] ($Title[1])\n\n"; print MAIL "The \"Legal\" for this auction was $Legal[1].\n\n"; print MAIL "Title documents will be made as follows:\n\n"; print MAIL "Name : $Title_name[1]\n"; print MAIL "Address 1 : $Addressa[1]\n"; if ($Addressb[1] ne ""){ print MAIL "Address 2 : $Addressb[1]\n"; } print MAIL "City : $City[1]\n"; print MAIL "State/Region : $State[1]\n"; print MAIL "Zip/Postal Code: $Zip_postal[1]\n"; print MAIL "Country : $Country[1]\n\n"; print MAIL "Amount due to be returned with documents (check or money order): \$$Check_amount[1]\n\n"; print MAIL "If you have not been to PayPal to process the document fee, you may click the link below (or copy & paste it into your broswer) to do so now:\n"; print MAIL "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=info%40gotacres%2ecom&item_name=Got%20Acres%20Processing%20Fee&amount=199\n\n"; if ($This_seller_name[1] =~ /doug/i){ print MAIL "If you have any questions please call me toll free at 800-421-7163 or outside the U.S. at 714-435-0324.\n\n"; } elsif ($This_seller_name[1] =~ /arlene/i){ print MAIL "If you have any questions please call me at 916-687-8118.\n\n"; } print MAIL "Yours sincerely,\n\n"; print MAIL "$This_seller_name[1]\n\n"; close MAIL; #vtext.com open (MAIL,"|/usr/sbin/sendmail -f dougcaffey\@gotacres.com klj929598\@aol.com"); print MAIL "From: Doug Caffey \n"; print MAIL "To: Dena Willmon \n"; print MAIL "Subject: Title details for completed auction!\n\n"; print MAIL "Here are the title details for auction # $Auction_id[1] ($Title[1])\n\n"; print MAIL "Seller was $This_seller_name[1].\n\n"; print MAIL "The \"Legal\" for this auction was $Legal[1].\n\n"; print MAIL "Title documents should be made as follows:\n\n"; print MAIL "Name : $Title_name[1]\n"; print MAIL "Address 1 : $Addressa[1]\n"; if ($Addressb[1] ne ""){ print MAIL "Address 2 : $Addressb[1]\n"; } print MAIL "City : $City[1]\n"; print MAIL "State/Region : $State[1]\n"; print MAIL "Zip/Postal Code: $Zip_postal[1]\n"; print MAIL "Country : $Country[1]\n"; print MAIL "Phone : $Contact_phone[1]\n\n"; print MAIL "Listed Price of Land : \$$Sell_price[1]\n"; print MAIL "Amount due upon receipt of documents: \$$Check_amount[1]\n\n"; print MAIL "Details at http://www.gotacres.com/doug/\n"; close MAIL; open (MAIL,"|/usr/sbin/sendmail -f webmaster\@gotacres.com 7147428374\@vtext.com"); #open (MAIL,"|/usr/sbin/sendmail -f webmaster\@gotacres.com 7146056700\@mymetropcs.com"); print MAIL "From: GotAcres\n"; print MAIL "To: Doug\n"; print MAIL "Subject: Title Det. Rcvd!\n\n"; print MAIL "Title Det auc # $Auction_id[1] Dena told"; close MAIL; open (MAIL,"|/usr/sbin/sendmail -f webmaster\@gotacres.com $This_seller_email[1]"); #open (MAIL,"|/usr/sbin/sendmail -f webmaster\@gotacres.com webmaster\@gotacres.com"); print MAIL "From: $Title_name[1] <$Contact_email[1]>\n"; print MAIL "To: $This_seller_name[1] <$This_seller_email[1]>\n"; print MAIL "Subject: Title details for completed auction!\n\n"; print MAIL "Here are the title details for auction # $Auction_id[1] ($Title[1])\n\n"; print MAIL "The \"Legal\" for this auction was $Legal[1].\n\n"; print MAIL "Title documents should be made as follows:\n\n"; print MAIL "Name : $Title_name[1]\n"; print MAIL "Address 1 : $Addressa[1]\n"; if ($Addressb[1] ne ""){ print MAIL "Address 2 : $Addressb[1]\n"; } print MAIL "City : $City[1]\n"; print MAIL "State/Region : $State[1]\n"; print MAIL "Zip/Postal Code: $Zip_postal[1]\n"; print MAIL "Country : $Country[1]\n"; print MAIL "Phone : $Contact_phone[1]\n\n"; print MAIL "Listed Price of Land : \$$Sell_price[1]\n"; print MAIL "Amount due upon receipt of documents: \$$Check_amount[1]\n\n"; print MAIL "Bonus information! This person came via "; if ($Referred_by_other eq ""){ print MAIL "$Referred_by!\n"; } else { print MAIL "$Referred_by_other!\n"; } close MAIL; if ($This_seller_name !~ /doug/i){ open (MAIL,"|/usr/sbin/sendmail -f webmaster\@gotacres.com dougcaffey\@gotacres.com"); print MAIL "From: Michael \n"; print MAIL "To: Doug Caffey \n"; print MAIL "Subject: Title details for completed auction (not one of yours!)\n\n"; print MAIL "Here are the title details for auction # $Auction_id[1] ($Title[1])\n\n"; print MAIL "This was one of $This_seller_name[1]\'s parcels. They were emailed the details before you.\n\n"; print MAIL "The \"Legal\" for this auction was $Legal[1].\n\n"; print MAIL "Title documents should be made as follows:\n\n"; print MAIL "Name : $Title_name[1]\n"; print MAIL "Address 1 : $Addressa[1]\n"; if ($Addressb[1] ne ""){ print MAIL "Address 2 : $Addressb[1]\n"; } print MAIL "City : $City[1]\n"; print MAIL "State/Region : $State[1]\n"; print MAIL "Zip/Postal Code: $Zip_postal[1]\n"; print MAIL "Country : $Country[1]\n"; print MAIL "Phone : $Contact_phone[1]\n\n"; print MAIL "Listed Price of Land : \$$Sell_price[1]\n"; print MAIL "Amount due upon receipt of documents: \$$Check_amount[1]\n\n"; print MAIL "Bonus information! This person came via "; if ($Referred_by_other eq ""){ print MAIL "$Referred_by!\n"; } else { print MAIL "$Referred_by_other!\n"; } close MAIL; } open (MAIL,"|/usr/sbin/sendmail -f webmaster\@gotacres.com webmaster\@gotacres.com"); print MAIL "From: $Title_name[1] <$Contact_email[1]>\n"; print MAIL "To: Webmaster \n"; print MAIL "Subject: Title details for completed auction!\n\n"; print MAIL "Here are the title details for auction # $Auction_id[1] ($Title[1])\n\n"; print MAIL "Seller was $This_seller_name[1].\n\n"; print MAIL "The \"Legal\" for this auction was $Legal[1].\n\n"; print MAIL "Title documents should be made as follows:\n\n"; print MAIL "Name : $Title_name[1]\n"; print MAIL "Address 1 : $Addressa[1]\n"; if ($Addressb[1] ne ""){ print MAIL "Address 2 : $Addressb[1]\n"; } print MAIL "City : $City[1]\n"; print MAIL "State/Region : $State[1]\n"; print MAIL "Zip/Postal Code: $Zip_postal[1]\n"; print MAIL "Country : $Country[1]\n"; print MAIL "Phone : $Contact_phone[1]\n\n"; print MAIL "Listed Price of Land : \$$Sell_price[1]\n"; print MAIL "Amount due upon receipt of documents: \$$Check_amount[1]\n\n"; print MAIL "Bonus information! This person came via "; if ($Referred_by_other eq ""){ print MAIL "$Referred_by!\n"; } else { print MAIL "$Referred_by_other!\n"; } close MAIL; } else { $mailed=0; until ($mailed >= $woncount){ $mailed++; if ($This_seller_name[$mailed] ne $lastsellername){ if ($lastsellername ne ""){ if ($This_seller_name[$mailed] =~ /doug/i){ print MAIL "If you have any questions please call me toll free at 800-421-7163 or outside the U.S. at 714-435-0324.\n\n"; } elsif ($This_seller_name[$mailed] =~ /arlene/i){ print MAIL "If you have any questions please call me at 916-687-8118.\n\n"; } print MAIL "Yours sincerely,\n\n"; print MAIL "$This_seller_name[$mailed]\n\n"; close MAIL; } $lastsellername = $This_seller_name[$mailed]; open (MAIL,"|/usr/sbin/sendmail -f $This_seller_email[$mailed] $Contact_email[$mailed]"); #open (MAIL,"|/usr/sbin/sendmail -f webmaster\@gotacres.com webmaster\@gotacres.com"); print MAIL "From: $This_seller_name[$mailed] <$This_seller_email[$mailed]>\n"; print MAIL "To: $Title_name[1] <$Contact_email[1]>\n"; print MAIL "Subject: Title details for completed auction(s)!\n\n"; } print MAIL "For auction # $Auction_id[$mailed] ($Title[$mailed])\n\n"; print MAIL "Title documents will be made as follows:\n\n"; print MAIL "Name : $Title_name[$mailed]\n"; print MAIL "Address 1 : $Addressa[$mailed]\n"; if ($Addressb[$mailed] ne ""){ print MAIL "Address 2 : $Addressb[1]\n"; } print MAIL "City : $City[$mailed]\n"; print MAIL "State/Region : $State[$mailed]\n"; print MAIL "Zip/Postal Code: $Zip_postal[$mailed]\n"; print MAIL "Country : $Country[$mailed]\n\n"; print MAIL "Amount due to be returned with documents (check or money order): \$$Check_amount[$mailed]\n\n"; print MAIL "If you have not been to PayPal to process the document fee, you may click the link below (or copy & paste it into your broswer) to do so now:\n"; print MAIL "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=info%40gotacres%2ecom&item_name=Got%20Acres%20Processing%20Fee&amount=199\n\n"; print MAIL "--------------------------------------------------------------------------------------------------------------------------------------------\n\n"; } if ($This_seller_name[$mailed] =~ /doug/i){ print MAIL "If you have any questions please call me toll free at 800-421-7163 or outside the U.S. at 714-435-0324.\n\n"; } elsif ($This_seller_name[$mailed] =~ /arlene/i){ print MAIL "If you have any questions please call me at 916-687-8118.\n\n"; } print MAIL "Yours sincerely,\n\n"; print MAIL "$This_seller_name[$mailed]\n\n"; close MAIL; $mailed=0; until ($mailed >= $woncount){ $mailed++; if ($This_seller_name[$mailed] ne $lastsellername){ if ($lastsellername ne ""){ if ($This_seller_name[$mailed] =~ /doug/i){ print MAIL "If you have any questions please call me toll free at 800-421-7163 or outside the U.S. at 714-435-0324.\n\n"; } elsif ($This_seller_name[$mailed] =~ /arlene/i){ print MAIL "If you have any questions please call me at 916-687-8118.\n\n"; } print MAIL "Yours sincerely,\n\n"; print MAIL "$This_seller_name[$mailed]\n\n"; close MAIL; } $lastsellername = $This_seller_name[$mailed]; open (MAIL,"|/usr/sbin/sendmail -f $This_seller_email[$mailed] $This_seller_email[$mailed]"); #open (MAIL,"|/usr/sbin/sendmail -f webmaster\@gotacres.com webmaster\@gotacres.com"); print MAIL "From: $Title_name[1] <$Contact_email[1]>\n"; print MAIL "To: $This_seller_name[$mailed] <$This_seller_email[$mailed]>\n"; print MAIL "Subject: Title details for completed auction(s)!\n\n"; } print MAIL "For auction # $Auction_id[$mailed] ($Title[$mailed])\n\n"; print MAIL "Title documents will be made as follows:\n\n"; print MAIL "Name : $Title_name[$mailed]\n"; print MAIL "Address 1 : $Addressa[$mailed]\n"; if ($Addressb[$mailed] ne ""){ print MAIL "Address 2 : $Addressb[1]\n"; } print MAIL "City : $City[$mailed]\n"; print MAIL "State/Region : $State[$mailed]\n"; print MAIL "Zip/Postal Code: $Zip_postal[$mailed]\n"; print MAIL "Country : $Country[$mailed]\n\n"; print MAIL "Listed Price of Land : \$$Sell_price[$mailed]\n"; print MAIL "Amount due to be returned with documents (check or money order): \$$Check_amount[$mailed]\n\n"; print MAIL "--------------------------------------------------------------------------------------------------------------------------------------------\n\n"; } if ($This_seller_name[$mailed] =~ /doug/i){ print MAIL "If you have any questions please call me toll free at 800-421-7163 or outside the U.S. at 714-435-0324.\n\n"; } elsif ($This_seller_name[$mailed] =~ /arlene/i){ print MAIL "If you have any questions please call me at 916-687-8118.\n\n"; } print MAIL "Yours sincerely,\n\n"; print MAIL "$This_seller_name[$mailed]\n\n"; close MAIL; $onenotdoug = "No"; $dug=0; until ($dug >= $woncount){ $dug++; if ($This_seller_name[$dug] !~ /doug/i){ $onenotdoug = "Yes"; } } if ($onenotdoug eq "Yes"){ open (MAIL,"|/usr/sbin/sendmail -f webmaster\@gotacres.com dougcaffey\@gotacres.com"); print MAIL "From: Webmaster \n"; print MAIL "To: Doug Caffey \n"; print MAIL "Subject: Title details for completed auction(s) (not yours)!\n\n"; $mailed=0; until ($mailed >= $woncount){ $mailed++; if ($This_seller_name !~ /doug/){ print MAIL "For auction # $Auction_id[$mailed] ($Title[$mailed])\n\n"; print MAIL "Title documents will be made as follows:\n\n"; print MAIL "Name : $Title_name[$mailed]\n"; print MAIL "Address 1 : $Addressa[$mailed]\n"; if ($Addressb[$mailed] ne ""){ print MAIL "Address 2 : $Addressb[1]\n"; } print MAIL "City : $City[$mailed]\n"; print MAIL "State/Region : $State[$mailed]\n"; print MAIL "Zip/Postal Code: $Zip_postal[$mailed]\n"; print MAIL "Country : $Country[$mailed]\n\n"; print MAIL "Listed Price of Land : \$$Sell_price[$mailed]\n"; print MAIL "Amount due to be returned with documents (check or money order): \$$Check_amount[$mailed]\n"; print MAIL "Link to auction: http://www.gotacres.com/auction/index.php?a=2&b=$Auction_id[$mailed]\n\n"; print MAIL "--------------------------------------------------------------------------------------------------------------------------------------------\n\n"; } } print MAIL "Have a great day!\n\n"; close MAIL; } open (MAIL,"|/usr/sbin/sendmail -f dougcaffey\@gotacres.com klj929598\@aol.com"); print MAIL "From: Doug Caffey \n"; print MAIL "To: Dena Willmon\n"; print MAIL "Subject: Title details for completed auction(s)!\n\n"; $mailed=0; until ($mailed >= $woncount){ $mailed++; print MAIL "For auction # $Auction_id[$mailed] ($Title[$mailed])\n\n"; print MAIL "Title documents will be made as follows:\n\n"; print MAIL "Name : $Title_name[$mailed]\n"; print MAIL "Address 1 : $Addressa[$mailed]\n"; if ($Addressb[$mailed] ne ""){ print MAIL "Address 2 : $Addressb[1]\n"; } print MAIL "City : $City[$mailed]\n"; print MAIL "State/Region : $State[$mailed]\n"; print MAIL "Zip/Postal Code: $Zip_postal[$mailed]\n"; print MAIL "Country : $Country[$mailed]\n\n"; print MAIL "Listed Price of Land : \$$Sell_price[$mailed]\n"; print MAIL "Amount due to be returned with documents (check or money order): \$$Check_amount[$mailed]\n"; print MAIL "Link to auction: http://www.gotacres.com/auction/index.php?a=2&b=$Auction_id[$mailed]\n\n"; print MAIL "--------------------------------------------------------------------------------------------------------------------------------------------\n\n"; } print MAIL "Details at http://www.gotacres.com/doug/\n\n"; print MAIL "Have a great day!\n\n"; close MAIL; open (MAIL,"|/usr/sbin/sendmail -f webmaster\@gotacres.com 7147428374\@vtext.com"); #open (MAIL,"|/usr/sbin/sendmail -f webmaster\@gotacres.com 7146056700\@mymetropcs.com"); print MAIL "From: GotAcres\n"; print MAIL "To: Doug\n"; print MAIL "Subject: Title Det. Rcvd!\n\n"; print MAIL "Title Det 4 more than 1 Dena told"; close MAIL; open (MAIL,"|/usr/sbin/sendmail -f webmaster\@gotacres.com webmaster\@gotacres.com"); print MAIL "From: $Title_name[1] <$Contact_email[1]>\n"; print MAIL "To: Webmaster \n"; print MAIL "Subject: Title details for completed auction(s)!\n\n"; $mailed=0; until ($mailed >= $woncount){ $mailed++; print MAIL "For auction # $Auction_id[$mailed] ($Title[$mailed])\n\n"; print MAIL "Title documents will be made as follows:\n\n"; print MAIL "Name : $Title_name[$mailed]\n"; print MAIL "Address 1 : $Addressa[$mailed]\n"; if ($Addressb[$mailed] ne ""){ print MAIL "Address 2 : $Addressb[1]\n"; } print MAIL "City : $City[$mailed]\n"; print MAIL "State/Region : $State[$mailed]\n"; print MAIL "Zip/Postal Code: $Zip_postal[$mailed]\n"; print MAIL "Country : $Country[$mailed]\n\n"; print MAIL "Listed Price of Land : \$$Sell_price[$mailed]\n"; print MAIL "Amount due to be returned with documents (check or money order): \$$Check_amount[$mailed]\n\n"; print MAIL "--------------------------------------------------------------------------------------------------------------------------------------------\n\n"; } print MAIL "Have a great day!\n\n"; close MAIL; } print "Content-type: text/html\n\n"; if ($woncount == 1){ open (CHEC, "checkout_template3"); until (eof (CHEC)){ $Chec = ; print "$Chec\n"; } close CHEC; exit; } else { open (CHEC, "checkout_template3_multiple"); until (eof (CHEC)){ $Chec = ; if ($Chec =~ /REPLACEPROPERTIES/){ print "
                            "; $checd=0; until ($checd >= $woncount){ print "
                          1. click here to pay document fee for Auction $Auction_id[$mailed] ($Legal[$mailed])\n"; } print "

                          "; } print "$Chec\n"; } close CHEC; exit; } } elsif ($This_action eq "Winning_bidder"){ print "Content-type: text/html\n\n"; open (CHEC, "winning_bidder_template1"); until (eof (CHEC)){ $Chec = ; chop $Chec; $Chec =~ s/REPLACEAUCTIONID/$Auction_id/g; $Chec =~ s/REPLACEUSERNAME/$User_name/g; $Chec =~ s/REPLACEAUCTIONTITLE/$Title/g; $Chec =~ s/REPLACEFIRSTNAME/$Title_name/g; $Chec =~ s/REPLACECITY/$City/g; $Chec =~ s/REPLACESTATE/$State/g; $Chec =~ s/REPLACECOUNTRY/$Country/g; $Chec =~ s/REPLACEEMAIL/$Contact_email/g; $Chec =~ s/REPLACECHECKAMOUNT/$Check_amount/g; #$Chec =~ s/auctioncheckout\.cgi/auctioncheckoutpp\.cgi/; print "$Chec\n"; } close CHEC; } elsif ($This_action eq "Get_winning_details"){ require "../../got_data/gotacresql.pl"; &SQLVAR; $User_id = $cgi->param('User_id'); $User_pass = $cgi->param('User_pass'); $Where_this = "WHERE id = \"$Auction_id\" AND live='0'"; $dbh = DBI->connect("DBI:mysql:database=$db_name;host=$db_host", $db_user, $db_pass, {'RaiseError' => 1}); $sth = $dbh->prepare("SELECT * FROM geodesic_auctions_userdata WHERE username LIKE \"%$User_id%\""); $sth->execute(); $ref = $sth->fetchrow_hashref; $User_id_num = $ref->{'id'}; $Contact_email = $ref->{'email'}; if ($User_id_num eq ""){ $Error = "We did not find a matching user! Click here to register or re-enter details below.

                          "; &DOBADUSERERROR; exit; } $sth = $dbh->prepare("SELECT * FROM geodesic_auctions_logins WHERE username LIKE \"%$User_id%\""); $sth->execute(); $ref = $sth->fetchrow_hashref; $Onfile_pass = $ref->{'password'}; if ($Onfile_pass eq ""){ die; } if (uc($Onfile_pass) ne uc($User_pass)){ $Error = "The password entered did not match the password on file!

                          "; &DOBADPASSERROR; exit; } else { $sth = $dbh->prepare("SELECT * FROM geodesic_auctions WHERE live='0' ORDER BY seller"); $sth->execute(); #$User_id= "137"; while ($ref = $sth->fetchrow_hashref){ $This_id = $ref->{'id'}; $sth1 = $dbh->prepare("SELECT * FROM geodesic_auctions_bids WHERE auction_id='$This_id' ORDER BY bid DESC"); $sth1->execute(); $ref1 = $sth1->fetchrow_hashref; if ($ref1->{'high_bidder'} == "0"){ if ($ref1->{'bidder'} == $User_id_num){ $woncount++; $Auction_won[$woncount] = $This_id; $Mike_hash_in = $ref->{'title'}; &GETMIKEHASH; $Title[$woncount] = $Mike_hash_in; $Description[$woncount] = $ref->{'description'}; $Amount_due[$woncount] = $ref->{'final_price'}; $All_winning_bids = $All_winning_bids+$ref->{'final_price'}; $All_doc_fees = $All_doc_fees+199; $Total_amount_due[$titlereceived] = $ref->{'final_price'}+199; } } else { if ($ref1->{'bidder'} == $User_id_num){ $titlereceived++; $Auction_step_one[$titlereceived] = $This_id; $Mike_hash_in = $ref->{'title'}; &GETMIKEHASH; $Title_step_one[$titlereceived] = $Mike_hash_in; $Description_step_one[$titlereceived] = $ref->{'description'}; $Amount_due_step_one[$titlereceived] = $ref->{'final_price'}; $All_winning_bids = $All_winning_bids+$ref->{'final_price'}; $All_doc_fees = $All_doc_fees+199; $Total_amount_due[$titlereceived] = $ref->{'final_price'}+199; $Final_fee_step_one[$titlereceived] = $ref->{'final_fee'}; } } } if ($woncount eq "" || $User_id =~ /mikeca/i){ if ($titlereceived eq ""){ &DONOCURRENTWINNER; exit; } else { &DOTITLEDETAILSCOMPLETED; exit; } } print "Content-type: text/html\n\n"; $ECAmt1 = $Amount_due[1]+199; if ($ECAmt1 ne "199.00"){ $ECAmt1 .= ".00"; } #$woncount=1; if ($woncount ==1){ open (CHEC, "checkout_template_newpp"); #$Auction_id = $Auction_id[1]; #$Title = $Auction_title[1]; until (eof (CHEC)){ $Chec = ; chop $Chec; $Chec =~ s/REPLACEAUCTIONID/$Auction_won[1]/g; $Chec =~ s/REPLACEUSERNAME/$User_id/g; $Chec =~ s/REPLACEAUCTIONTITLE/$Title[1]/g; $Chec =~ s/REPLACEFIRSTNAME/$Title_name/g; $Chec =~ s/REPLACECITY/$City/g; $Chec =~ s/REPLACESTATE/$State/g; $Chec =~ s/REPLACECOUNTRY/$Country/g; $Chec =~ s/REPLACEEMAIL/$Contact_email/g; $Chec =~ s/REPLACECHECKAMOUNT/$Amount_due[1]/g; $Chec =~ s/REPLACEWINNINGBID/$Amount_due[1]/; $Chec =~ s/REPLACETOTALDUE/$ECAmt1/; #$Chec =~ s/auctioncheckout\.cgi/auctioncheckoutpp\.cgi/g; print "$Chec\n"; } } elsif ($woncount >1){ open (CHEC, "checkout_template_multiplepp"); $Auction_won = $Auction_won[1]; $Title = $Title[1]; until (eof (CHEC)){ $Chec = ; chop $Chec; $Chec =~ s/REPLACEAUCTIONID/$Auction_won/g; $Chec =~ s/REPLACEUSERNAME/$User_id/g; $Chec =~ s/REPLACEAUCTIONTITLE/$Title[1]/g; $Chec =~ s/REPLACEFIRSTNAME/$Title_name/g; $Chec =~ s/REPLACECITY/$City/g; $Chec =~ s/REPLACESTATE/$State/g; $Chec =~ s/REPLACECOUNTRY/$Country/g; $Chec =~ s/REPLACEEMAIL/$Contact_email/g; $Chec =~ s/REPLACECHECKAMOUNT/$Amount_due[1]/g; $Chec =~ s/REPLACEWONCOUNT/$woncount/g; $Chec =~ s/REPLPACEREFERREDBYOTHER/$Referred_by_other/g; $Chec =~ s/REPLACEREFERREDBY/$Referred_by/g; if ($Chec =~ /PRINTADDITIONALAUCTIONS/){ $printedcount=1; print "

                          Click this box to use the above details for all properties shown. Or, fill in the complete details for one or more and the remaining will use the above.

                          \n"; until ($printedcount >= $woncount){ $printedcount++; print "

                          Auction # $Auction_won[$printedcount] for $Title[$printedcount]

                          \n"; print "

                          \n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
                          Precise name or names you want on title to the land:*
                          Address 1*
                          Address 2
                          City*
                          State/Region*
                          Zip/Postal Code*
                          Country*
                          Email*
                          Phone*

                          \n"; } } else { if ($Chec =~ /CLICK HERE to review above information/){ $pmttyp=0; $Total_fee = $All_winning_bids+$All_doc_fees; if ($Total_fee !~ /\./){ $Total_fee .= ".00"; } if ($All_doc_fees !~ /\./){ $All_doc_fees .= ".00"; } if ($All_winning_bids !~ /\./){ $All_winning_bids .= ".00"; } print "

                          Select payment type:

                          Your winning bids total \$$All_winning_bids. Your document fees total \$$All_doc_fees. Your payment options are for the total\n"; print "of your winning bids and document fees (\$$Total_fee) or to pay the document fees only (\$$All_doc_fees) if you wish to return a check or money order\n"; print "with your documents.

                          \n"; print "

                          The programmer of this software anticipated times when not all the parcels won would be taken and as such you may select \"No\" below for parcels\n"; print "you do not wish to purchase at this time. Your adjusted total for your payment choice below will show on the next screen. Additionally, you can still purchase any parcels not taken at this time up until they are relisted.

                          \n"; print "\n"; until ($pmttype >= $woncount){ $pmttype++; print "\n"; } print "
                          Auction #DescriptionWinning BidDocument FeeKeep Property?
                          $Auction_won[$pmttype]$Title[$pmttype]\$$Amount_due[$pmttype]\$199.00
                          No

                          \n"; print "Both (\$$Total_fee) Document fees only (\$$All_doc_fees)

                          \n"; } #$Chec =~ s/auctioncheckout\.cgi/auctioncheckoutpp\.cgi/; print "$Chec\n"; } } } } close CHEC; } ############################################################################################################################################################################### sub DONOTENOUGHINFOERROR { open (CHEC, "checkout_template4"); print "Content-type: text/html\n\n"; until (eof (CHEC)){ $Chec = ; chop $Chec; print "$Chec\n"; } close CHEC; exit; } ############################################################################################################################################################################### sub DOCHECKOUTERROR { open (CHEC, "checkout_template_errorpp"); if ($Payment_type eq "Both"){ $replaceboth = "checked"; } elsif ($Payment_type eq "Documents"){ $replacedocuments = "checked"; } print "Content-type: text/html\n\n"; until (eof (CHEC)){ $Chec = ; chop $Chec; $Chec =~ s/REPLACEUSERNAME/$User_name/g; $Chec =~ s/REPLACEAUCTIONID/$Auction_id[1]/g; $Chec =~ s/REPLACEERROR/$Error/g; $Chec =~ s/REPLACEAUCTIONTITLE/$Title[1]/g; $Chec =~ s/REPLACETITLENAME/$Title_name[1]/g; $Chec =~ s/REPLACEADDRESS1/$Addressa[1]/g; $Chec =~ s/REPLACEADDRESS2/$Addressb[1]/g; $Chec =~ s/REPLACECITY/$City[1]/g; $Chec =~ s/REPLACESTATE/$State[1]/g; $Chec =~ s/REPLACEZIP/$Zip_postal[1]/g; $Chec =~ s/REPLACECOUNTRY/$Country[1]/g; $Chec =~ s/REPLACEEMAIL/$Contact_email[1]/g; $Chec =~ s/REPLACEREFERREDBYOTHER/$Referred_by_other/g; $Chec =~ s/REPLACEREFERREDBY/$Referred_by/g; $Chec =~ s/REPLACEPHONE/$Contact_phone[1]/g; $Chec =~ s/REPLACECHECKAMOUNT/$Check_amount[1]/g; $Chec =~ s/REPLACEWINNINGBID/$Amount_bid_due/; $Chec =~ s/REPLACETOTALDUE/$ECAmt/; $Chec =~ s/REPLACEPAYMENTBOTH/$replaceboth/; $Chec =~ s/REPLACEPAYMENTDOCUMENTS/$replacedocuments/; #$Chec =~ s/auctioncheckout\.cgi/auctioncheckoutpp\.cgi/g; print "$Chec\n"; } close CHEC; exit; } ############################################################################################################################################################################# sub DONOCURRENTWINNER { open (CHEC, "no_winning_auctionr_template"); print "Content-type: text/html\n\n"; until (eof (CHEC)){ $Chec = ; chop $Chec; print "$Chec\n"; } exit; } ############################################################################################################################################################################# sub DOBADUSERERROR { print "Content-type: text/html\n\n"; open (CHEC, "user_not_found_template"); until (eof (CHEC)){ $Chec = ; chop $Chec; $Chec =~ s/REPLACEERROR/$Error/; $Chec =~ s/REPLACEUSERID//; print "$Chec\n"; } close CHEC; } ############################################################################################################################################################################# sub DOBADPASSERROR { print "Content-type: text/html\n\n"; open (CHEC, "user_not_found_template"); until (eof (CHEC)){ $Chec = ; chop $Chec; $Chec =~ s/REPLACEERROR/$Error/; $Chec =~ s/REPLACEUSERID/$User_id/; print "$Chec\n"; } close CHEC; } ############################################################################################################################################################################# sub CHEKONEFORERRORS { if ($Keep_parcel[1] eq ""){ if ($Title_name[1] eq ""){ if ($Error eq ""){ $Error = "

                            "; } $Error .= "
                          1. You must include the legal name of the person to whom the title will be issued!"; $errcnt++; } if ($Addressa[1] eq ""){ if ($Error eq ""){ $Error = "
                              "; } $Error .= "
                            1. You must include the address to which we will send the documents!"; $errcnt++; } if ($City[1] eq ""){ if ($Error eq ""){ $Error = "
                                "; } $Error .= "
                              1. You must include the city to which we will send the documents!"; $errcnt++; } if ($Zip_postal[1] eq ""){ if ($Error eq ""){ $Error = "
                                  "; } $Error .= "
                                1. You must include the Zip or Postal Code to which we will send the documents! (If none, enter None)"; $errcnt++; } if ($Country[1] eq ""){ if ($Error eq ""){ $Error = "
                                    "; } $Error .= "
                                  1. You must include the country to which we will send the documents!"; $errcnt++; } if ($Contact_email[1] eq ""){ if ($Error eq ""){ $Error = "
                                      "; } $Error .= "
                                    1. You must include an email address!"; $errcnt++; } if ($Contact_phone[1] eq ""){ if ($Error eq ""){ $Error = "
                                        "; } $Error .= "
                                      1. You didn't enter your phone number!"; $errcnt++; } $Multiple_amount_due = $Check_amount[1]; $All_doc_fees = 199; $All_winning_bids = $Check_amount[1]; } } ############################################################################################################################################################################# sub GETMULTIPLEDATA { $checkcnt = 1; if ($Multiple_amount_due eq ""){ $Multiple_amount_due = $Check_amount[1]+199; } $All_doc_fees = 199; until ($checkcnt >= $woncount){ $checkcnt++; $All_doc_fees = $All_doc_fees+199; $Title_name[$checkcnt] = $Title_name[1]; $Addressa[$checkcnt] = $Addressa[1]; $Addressb[$checkcnt] = $Addressb[1]; $City[$checkcnt] = $City[1]; $State[$checkcnt] = $State[1]; $Zip_postal[$checkcnt] = $Zip_postal[1]; $Contact_email[$checkcnt] = $Contact_email[1]; $Contact_phone[$checkcnt] = $Contact_phone[1]; $Country[$checkcnt] = $Country[1]; $Multiple_amount_due = $Multiple_amount_due+($Check_amount[$checkcnt]+199); } } ############################################################################################################################################################################# sub CHECKMULTIPLEFORERRORS { $checkcnt = 1; until ($checkcnt >= $woncount){ $checkcnt++; if ($Keep_parcel[$checkcnt] eq ""){ $All_doc_fees = $All_doc_fees+199; if ($Title_name[$checkcnt] eq ""){ if ($Error eq ""){ $Error = "
                                          "; } $Error .= "
                                        1. You must include the legal name of the person to whom the title will be issued for $Title[$checkcnt]!"; $errcnt++; } if ($Addressa[$checkcnt] eq ""){ if ($Error eq ""){ $Error = "
                                            "; } $Error .= "
                                          1. You must include the address to which we will send the documents for $Title[$checkcnt]!"; $errcnt++; } if ($City[$checkcnt] eq ""){ if ($Error eq ""){ $Error = "
                                              "; } $Error .= "
                                            1. You must include the city to which we will send the documents for $Title[$checkcnt]!"; $errcnt++; } if ($Zip_postal[$checkcnt] eq ""){ if ($Error eq ""){ $Error = "
                                                "; } $Error .= "
                                              1. You must include the Zip or Postal Code to which we will send the documents for $Title[$checkcnt]! (If none, enter None)"; $errcnt++; } if ($Country[$checkcnt] eq ""){ if ($Error eq ""){ $Error = "
                                                  "; } $Error .= "
                                                1. You must include the country to which we will send the documents for $Title[$checkcnt]!"; $errcnt++; } if ($Contact_email[$checkcnt] eq ""){ if ($Error eq ""){ $Error = "
                                                    "; } $Error .= "
                                                  1. You must include an email address for $Title[$checkcnt]!"; $errcnt++; } if ($Contact_phone[$checkcnt] eq ""){ if ($Error eq ""){ $Error = "
                                                      "; } $Error .= "
                                                    1. You didn't enter a phone number for $Title[$checkcnt]!"; $errcnt++; } $Multiple_amount_due = $Multiple_amount_due+($Check_amount[$checkcnt]); $All_winning_bids = $All_winning_bids+$Check_amount[$checkcnt]; } } } ############################################################################################################################################################################# sub DOMULTIPLEERROR { open (CHEC, "checkout_template_error1pp"); print "Content-type: text/html\n\n"; $Error .= "
                                                    "; if ($Multiple_amount_due !~ /\./){ $Multiple_amount_due .= ".00"; } if ($All_doc_fees !~ /\./){ $All_doc_fees .= ".00"; } if ($Payment_type eq "Both"){ $Both_status = "checked"; } elsif ($Payment_type eq "Documents"){ $Document_status = "checked"; } $addmon=0; until ($addmon >= $woncount){ $addmon++; if ($Keep_parcel[$addmon] ne ""){ $Multiple_amount_due = $Multiple_amount_due+($Check_amount[$addmon]); $All_winning_bids = $All_winning_bids+$Check_amount[$addmon]; $All_doc_fees = $All_doc_fees+199; } } until (eof (CHEC)){ $Chec = ; chop $Chec; $Chec =~ s/REPLACEERROR/$Error/g; $Chec =~ s/REPLACEAUCTIONID/$Auction_id[1]/g; $Chec =~ s/REPLACEAUCTIONTITLE/$Title[1]/g; $Chec =~ s/REPLACECHECKAMOUNT/$Check_amount[1]/g; $Chec =~ s/REPLACETITLENAME/$Title_name[1]/g; $Chec =~ s/REPLACEUSERNAME/$User_name/g; $Chec =~ s/REPLACEADDRESS1/$Addressa[1]/g; $Chec =~ s/REPLACEADDRESS2/$Addressb[1]/g; $Chec =~ s/REPLACECITY/$City[1]/g; $Chec =~ s/REPLACESTATE/$State[1]/g; $Chec =~ s/REPLACEZIP/$Zip_postal[1]/g; $Chec =~ s/REPLACECOUNTRY/$Country[1]/g; $Chec =~ s/REPLACEEMAIL/$Contact_email[1]/g; $Chec =~ s/REPLACEPHONE/$Contact_phone[1]/g; $Chec =~ s/REPLPACEREFERREDBYOTHER/$Referred_by_other/g; $Chec =~ s/REPLACEREFERREDBY/$Referred_by/g; $Chec =~ s/REPLACEWONCOUNT/$woncount/g; if ($Chec =~ /REPLACEOTHERAUCTIONS/){ $printedcount=1; if ($One_for_all ne ""){ $One_for_all = "checked"; } print "

                                                    Click this box to use the above details for all auctions won presented here. Or, fill in the complete details for one or more and the remaining will use the above.

                                                    \n"; until ($printedcount >= $woncount){ $printedcount++; print "

                                                    Auction # $Auction_id[$printedcount] for $Title[$printedcount]

                                                    \n"; print "

                                                    \n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
                                                    Precise name or names you want on title to the land:*
                                                    Address 1*
                                                    Address 2
                                                    City*
                                                    State/Region*
                                                    Zip/Postal Code*
                                                    Country*
                                                    Email*
                                                    Phone*

                                                    \n"; } } else { if ($Chec =~ /CLICK HERE to review above information/){ $pmttyp=0; $Total_fee = $All_winning_bids+$All_doc_fees; if ($Total_fee !~ /\./){ $Total_fee .= ".00"; } if ($All_doc_fees !~ /\./){ $All_doc_fees .= ".00"; } $All_winning_bids = $Multiple_amount_due+$All_doc_fees; if ($All_winning_bids !~ /\./){ $All_winning_bids .= ".00"; } print "

                                                    Select payment type:

                                                    Your winning bids total \$$Multiple_amount_due. Your document fees total \$$All_doc_fees. Your payment options are for the total\n"; print "of your winning bids and document fees (\$$All_winning_bids) or to pay the document fees only (\$$All_doc_fees) if you wish to return a check or money order\n"; print "with your documents.

                                                    \n"; print "

                                                    The programmer of this software anticipated times when not all the parcels won would be taken and as such you may select \"No\" below for parcels you do not wish to purchase at this time. Additionally, you can still purchase any parcels not taken at this time up until they are relisted.

                                                    \n"; print "\n"; until ($pmttype >= $woncount){ $pmttype++; if ($Keep_parcel[$pmttype] ne ""){ $checkedp = "checked"; } else { $checkedp = ""; } print "\n"; } print "
                                                    Auction #DescriptionWinning BidDocument FeeKeep Property?
                                                    $Auction_id[$pmttype]$Title[$pmttype]\$$Check_amount[$pmttype]\$199.00
                                                    No

                                                    \n"; print "Both (\$$All_winning_bids) Document fees only (\$$All_doc_fees)

                                                    \n"; } #$Chec =~ s/auctioncheckout\.cgi/auctioncheckoutpp\.cgi/; print "$Chec\n"; } } } ############################################################################################################################################################################# sub DOTITLEDETAILSCOMPLETED { print "Content-type: text/html\n\n"; open (TEMP, "step_one_done_template"); if ($Final_fee_step_one[1] ne ""){ $Replace_note = "We have received everything we need to process this sale. If your title documents are not already on their way via Fedex® they will be shortly! If it has been more than 5 business days since you completed step two please call us at 714-435-0324."; } else { $Replace_note = "According to our records, you have won the following auction but we have not yet noted receipt of the \$149.00 document fee via PayPal®. If you have recently submitted it to PayPal® it may be in processing. Otherwise, please click the link below to do so at this time. If you have any questions please call us at 714-435-0324."; } until (eof (TEMP)){ $Temp = ; chop $Temp; $Temp =~ s/REPLACEFIRSTNAME/$User_id/g; $Temp =~ s/REPLACENOTE/$Replace_note/g; $Temp =~ s/REPLACEAUCTIONID/$Auction_step_one[1]/g; $Temp =~ s/REPLACEAUCTIONTITLE/$Title_step_one[1]/g; print "$Temp\n"; } close TEMP; } ############################################################################################################################################################################# sub GETEXPRESSCONFIG { use URI::Escape; require "../../got_data/gotacresql.pl"; &GETGOTAPISTUFF; #====CONFIGURATION SECTION===== # set mode of script. if "DEBUG" then print the RAW request and response strings #my $scriptMODE = "DEBUG"; #set root URL where nvp.cgi resides my $rootURL = "http://www.gotacres.com/auction/"; # SET UP API CREDENTIALS # -- PRODUCTION -- my $APIusername = "$API_username"; my $APIpassword = "$API_password"; my $APIsignature = "$API_signature"; #my $APISubject = ""; #$UseSB = "Y"; my $LiveURL = "https://api-3t.paypal.com/nvp"; # -- SANDBOX -- my $SBAPIusername = "webmas_1219854196_biz_api1.gotacres.com"; my $SBAPIpassword = "1219854201"; my $SBAPIsignature = "An5ns1Kso7MWUdW4ErQKJJJ4qi4-AdDqIYNQEUbHwOh0SOrRuiq.G55y"; my $SBAPISubject = ""; my $SandboxURL = "https://api-3t.sandbox.paypal.com/nvp"; # Other misc. needed vars for purposes of this example $ECRetURL = uri_escape($rootURL."auctioncheckout.cgi?call=GetECDetails"); $ECRetURl = my $ECRetURL; $ECCanclRetUrl = uri_escape($rootURL."auctioncheckout.cgi"); #my $ECAmt = "5.00"; # based on querystring, use Sandbox creds or not # read in the GET parameters - all of these will NOT be present all the time, this is done strictly for this example #$APIcall = param('call'); $refTxnId = $cgi->param('refTxnId'); $PayerID = $cgi->param('PayerID'); $ECToken = $cgi->param('token'); $pmtAction = $cgi->param('pmtAction'); # ===== SET CREDENTIAL STRING ====== if ($UseSB eq "Y"){ if ($SBAPISubject eq ""){ #$AuthString = uri_escape("USER=".$SBAPIusername."&PWD=".$SBAPIpassword."&SIGNATURE=".$SBAPIsignature."&VERSION=2.3"); $AuthString = "USER=".$SBAPIusername."&PWD=".$SBAPIpassword."&SIGNATURE=".$SBAPIsignature."&VERSION=2.3"; } else { #$AuthString = uri_escape("USER=".$SBAPIusername."&PWD=".$SBAPIpassword."&SIGNATURE=".$SBAPIsignature."&SUBJECT=".$SBAPISubject."&VERSION=2.3"); $AuthString = "USER=".$SBAPIusername."&PWD=".$SBAPIpassword."&SIGNATURE=".$SBAPIsignature."&SUBJECT=".$SBAPISubject."&VERSION=2.3"; } # set endpoint URL $URL = $SandboxURL } else { # LIVE API CALL if ($APISubject eq ""){ # $AuthString = uri_escape("USER=".$APIusername."&PWD=".$APIpassword."&SIGNATURE=".$APIsignature."&VERSION=2.3"); $AuthString = "USER=".$APIusername."&PWD=".$APIpassword."&SIGNATURE=".$APIsignature."&VERSION=2.3"; } else { # $AuthString = uri_escape("USER=".$APIusername."&PWD=".$APIpassword."&SIGNATURE=".$APIsignature."&SUBJECT=".$APISubject."&VERSION=2.3"); $AuthString = "USER=".$APIusername."&PWD=".$APIpassword."&SIGNATURE=".$APIsignature."&SUBJECT=".$APISubject."&VERSION=2.3"; } # set endpoint URL $URL = $LiveURL } } ############################################################################################################################################################################## sub GETAPIDETAILS { # once we have the reqeust string built, let's make the call by sending it to PayPal # post to PayPal use LWP::UserAgent; $ua = new LWP::UserAgent; $req = new HTTP::Request POST => $URL; # set header stuff #$req->content_type('application/x-www-form-urlencoded'); $req->content($AuthString.$APIrequest); # get response $res = $ua->request($req); # parse response into name/value pairs @pairs = split(/&/, $res->content); $count = 0; foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $variable{$name} = $value; $count++; } # This line prints the ENTIRE response string - for DEBUG if ($scriptMODE eq "DEBUG"){ print "the RESPONSE WAS:

                                                    ".$res->content."


                                                    "; } if ($res->is_success) { # lets assign some API response vars to local vars $Ack = $variable{'ACK'}; # if the HTTP request went through, then lets examine the response string - need to see if it is Success or Failure if ($Ack eq "Success"){ if ($APIcall eq "Refund"){ &printRefundTxnResponse(); } elsif ($APIcall eq "GetDetails"){ &printGetTxnDetailsResponse(); } elsif ($APIcall eq "SetExpressCheckout"){ &printSetExpressCheckoutResponse(); } elsif ($APIcall eq "GetECDetails"){ &printGetExpressCheckoutDetailsResponse(); } elsif ($APIcall eq "DoECPmt"){ &printDoExpressCheckoutPaymentResponse(); } elsif ($APIcall eq "Capture"){ &printDoCaptureResponse(); } elsif ($APIcall eq "DirectPayment"){ &printDirectPayResponse(); } else { # default print "API call was Successful - no specific parsing setup, yet :-)"; } } else { &printErrors($res->content); } } else { print "there was some problem with the HTTP request!
                                                    Mbr>"; print $res->content; } } ############################################################################################################################################################################## sub printErrors { $CorrelationID = $variable{'CORRELATIONID'}; $LongErrorMsg1 = $variable{'L_LONGMESSAGE0'}; $ShortErrorMsg1 = $variable{'L_SHORTMESSAGE0'}; $ResTimestamp = $variable{'TIMESTAMP'}; $ErrorCode1 = $variable{'L_ERRORCODE0'}; # output the response print "Content-type: text/html\n\n"; print "



                                                    API CALL FAILED!
                                                    "; print "Ack ".$Ack."
                                                    "; print "Correlation id ".$CorrelationID."
                                                    "; print "Error Code ".$ErrorCode1."
                                                    "; print "Long Error Msg ".$LongErrorMsg1."
                                                    "; print "Short Error Msg ".$ShortErrorMsg1."
                                                    "; print "Timestamp ".$ResTimestamp."
                                                    "; print "EndPoint URL ".$URL."
                                                    "; print "Payment for: $Payment_description
                                                    \n"; print "


                                                    "; } ############################################################################################################################################################################# sub printSetExpressCheckoutResponse { if ($Auction_id eq ""){ $Auction_id = $Auction_id[1]; } $tempfile = "$User_id"."$Auction_id"."temp.txt"; open (TEMP, ">temp/$tempfile"); #die; $kept=0; $ECAmt = 0; if ($woncount <1){ $woncount = 1; } until ($kept >= $woncount){ $kept++; if ($Keep_parcel[$kept] eq ""){ if ($Payment_type eq "Both"){ $Item_amount_due = $Check_amount[$kept]+199; } else { $Item_amount_due = 199; } print TEMP "$Title_name[$kept]\\$Addressa[$kept]\\$Addressb[$kept]\\$City[$kept]\\$State[$kept]\\$Zip_postal[$kept]\\$Country[$kept]\\$Contact_email[$kept]\\$Check_amount[$kept]\\$Auction_id[$kept]\\$Title[$kept]\\$Item_amount_due\\$Referred_by\\$Referred_by_other\n"; $new_woncount++; $Title_name[$new_woncount] = $Title_name[$kept]; $Addressa[$new_woncount] = $Addressa[$kept]; $Addressb[$new_woncount] = $Addressb[$kept]; $City[$new_woncount] = $City[$kept]; $State[$new_woncount] = $State[$kept]; $Zip_postal[$new_woncount] = $Zip_postal[$kept]; $Country[$new_woncount] = $Country[$kept]; $Contact_email[$new_woncount] = $Contact_email[$kept]; $Check_amount[$new_woncount] = $Check_amount[$kept]; $Auction_id[$new_woncount] = $Auction_id[$kept]; $Title[$new_woncount] = $Title[$kept]; $ECAmt = $ECAmt+$Item_amount_due; } } close TEMP; $ECToken= $variable{'TOKEN'}; $This_pp = " https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=".$ECToken.""; open (CHEC, "checkout_template1_newpp"); my $Thissession = "$User_id\:$Auction_id[1]"; push @cookies, $cgi->cookie(-name=>'gotacres.compp', -value=>($Thissession), -expires=>'+1h'); print $cgi->header(-cookie=>[@cookies]); $ECAmt .= ".00"; if ($Payment_type eq "Both"){ $Replace_checkout_type = "both the document fee and the winning bid (\$$ECAmt).

                                                    \n"; } else { $Replace_checkout_type = "just the document fee (\$199.00) and will return a check or money order for your winning bid with your signed documents.

                                                    \n"; } #$Auction_id .= ""; $PayPalButton = ""; until (eof (CHEC)){ $Chec = ; chop $Chec; $Chec =~ s/REPLACEAUCTIONID/$Auction_id[1] /g; $Chec =~ s/MIKEREPUSER/\/g; $Chec =~ s/REPLACEAUCTIONTITLE/$Title[1]/g; $Chec =~ s/REPLACETITLENAME/$Title_name[1]/g; $Chec =~ s/REPLACEADDRESS1/$Addressa[1]/g; $Chec =~ s/REPLACEADDRESS2/$Addressb[1]/g; $Chec =~ s/REPLACECITY/$City[1]/g; $Chec =~ s/REPLACESTATE/$State[1]/g; $Chec =~ s/REPLACEZIP/$Zip_postal[1]/g; $Chec =~ s/REPLACECOUNTRY/$Country[1]/g; $Chec =~ s/REPLACEEMAIL/$Contact_email[1]/g; $Chec =~ s/REPLACEPHONE/$Contact_phone[1]/g; $Chec =~ s/REPLACECHECKAMOUNT/$Check_amount[1]/g; $Chec =~ s/REPLACEREFERREDBYOTHER/$Referred_by_other/g; $Chec =~ s/REPLACEREFERREDBY/$Referred_by/g; $Chec =~ s/REPLACECHECKOUTTYPE/$Replace_checkout_type/; #$Chec =~ s/auctioncheckout\.cgi/auctioncheckoutpp\.cgi/g; #$Chec =~ s/PPBUTTON1/ if ($new_woncount >1 && $Chec =~ /REPLACEPAYPALBUTTON/){ $pcount=1; until ($pcount >= $new_woncount){ $pcount++; print "Auction # $Auction_id[$pcount] for $Title[$pcount]

                                                    \n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
                                                    Precise name or names you want on title to the land:*$Title_name[$pcount]
                                                    Address 1*$Addressa[$pcount]
                                                    Address 2$Addressb[$pcount]
                                                    City*$City[$pcount]
                                                    State/Region*$State[$pcount]
                                                    Zip/Postal Code*$Zip_postal[$pcount]
                                                    Country*USA
                                                    Email*$Email[$pcount]
                                                    Phone*$Contact_phone[$pcount]

                                                    \n"; } $Chec =~ s/REPLACEPAYPALBUTTON/$PayPalButton/; } elsif ($Chec =~ /REPLACEPAYPALBUTTON/){ $Chec =~ s/REPLACEPAYPALBUTTON/$PayPalButton/; } print "$Chec\n"; } close CHEC; exit; } ############################################################################################################################################################################# sub DOAPICALL { if ($APIcall eq "GetECDetails"){ my $Sql_cookie = $cgi->cookie('gotacres.compp'); my @cookied = split (/\:/ , $Sql_cookie); $User_id = $cookied[0]; $Auction_id = $cookied[1]; $tempfile = "$User_id"."$Auction_id"."temp.txt"; $Payment_due = ""; open (TEMP, "temp/$tempfile") || die; until (eof (TEMP)){ $Temp = ; chop $Temp; @temp1 = split (/\\/ , $Temp); $Payment_due = $Payment_due+$temp1[11]; $tempcount++; } #$Payment_due = $Temp; if ($Payment_due eq ""){ $Payment_due = "199.00"; } else { $Payment_due .= ".00"; } # Mike test hard set amount due #$Payment_due="1.00"; #push @cookies, $cgi->cookie(-name=>'gotacres.compp', -value=>($Thissession), -expires=>'+1h'); #print $cgi->header(-cookie=>[@cookies]); # ======================= # GET EXPRESS CHECKOUT DETAILS # ======================== # example URL to call this API # http://HOST/cgi-bin/poneal/NVP_perl/nvp.cgi?call=GetECDetails&UseSandbox=Y&token=EC-26S59879GF259703V&PayerID=TQX4Q4S9ZFQ7L #$APIrequest = uri_escape("&METHOD=GetExpressCheckoutDetails&TOKEN=".$ECToken); &GETEXPRESSCONFIG; $APIrequest = "&METHOD=GetExpressCheckoutDetails&TOKEN=".$ECToken; &GETAPIDETAILS; exit; $thisbutton = ""; open (HEAD, "gothead.pp"); until (eof (HEAD)){ $Head = ; chop $Head; print "$Head\n"; } close HEAD; print "

                                                    Authorize Payment - Last step!

                                                    \n"; print "

                                                    PayPal® has verified your details. Click the button below to authorize your payment of \$$Payment_due.

                                                    \n"; print "

                                                    $thisbutton

                                                    \n"; open (FOOT, "gotfoot.pp"); until (eof (FOOT)){ $Foot = ; chop $Foot; print "$Foot\n"; } } elsif ($APIcall eq "DoECPmt") { my $Sql_cookie = $cgi->cookie('gotacres.compp'); my @cookied = split (/\:/ , $Sql_cookie); $User_id = $cookied[0]; $Auction_id = $cookied[1]; $tempfile = "$User_id"."$Auction_id"."temp.txt"; open (TEMP, "temp/$tempfile") || die; $tempcount=0; require "../../got_data/gotacresql.pl"; &SQLVAR; $dbh = DBI->connect("DBI:mysql:database=$db_name;host=$db_host", $db_user, $db_pass, {'RaiseError' => 1}); until (eof (TEMP)){ $Temp = ; chop $Temp; @temp1 = split (/\\/ , $Temp); $Payment_due = $Payment_due+$temp1[11]; $tempcount++; $sth = $dbh->prepare("SELECT * FROM geodesic_auctions WHERE id='$temp1[9]'"); $sth->execute(); $ref = $sth->fetchrow_hashref; $Check_amount = $ref->{'final_price'}; $Mikes = $ref->{'description'}; $Mike_hash_in = $Mikes; &GETMIKEHASH; $Title = $Mike_hash_in; @miked = split (/\/ , $Mike_hash_in); $numelements = @miked; $countel = 0; until ($countel >= $numelements){ if ($miked[$countel] =~ /Legal:/){ @miked1 = split (/\(/ , $miked[$countel]); @miked1a = split (/\)/ , $miked1[1]); $This_parcel = "$miked1a[0]"; } $countel++; } if ($temp1[11] > 199){ if ($Payment_description eq ""){ $Payment_description = "Downpayment %26 document fee parcel $This_parcel"; $Payment_description[$tempcount] = "Downpayment %26 document fee parcel $This_parcel"; } else { $Payment_description .= ", Downpayment %26 document fee parcel $This_parcel"; $Payment_description[$tempcount] = "Downpayment %26 document fee parcel $This_parcel"; } } else { if ($Payment_description eq ""){ $Payment_description = "Document fee parcel $This_parcel"; $Payment_description[$tempcount] = "Document fee parcel $This_parcel"; } else { $Payment_description .= ", Document fee parcel $This_parcel"; $Payment_description[$tempcount] = "Document fee parcel $This_parcel"; } } $Parcel_number[$tempcount] = $This_parcel; $Seller[$tempcount] = $ref->{'seller'}; $Title_name[$tempcount] = $temp1[0]; $Addressa[$tempcount] = $temp1[1]; $Addressb[$tempcount] = $temp1[2]; $City[$tempcount] = $temp1[3]; $State[$tempcount] = $temp1[4]; $Zip_postal[$tempcount] = $temp1[5]; $Country[$tempcount] = $temp1[6]; $Contact_email[$tempcount] = $temp1[7]; $Winning_bid[$tempcount] = $temp1[8]; $Auction_id[$tempcount] = $temp1[9]; $Title[$tempcount] = $temp1[10]; $Amount[$tempcount] = $temp1[11]; $Bonus_information = $temp1[12]; $Bonus_other = $temp1[13]; #print TEMP "$Title_name[1]\\$Addressa[1]\\$Addressa[2]\\$City[1]\\$State[1]\\$Zip_postal[1]\\$Country[1]\\$Contact_email[1]\\$Check_amount[1]\\$Auction_id[1]\\$Title[1]\\$ECAmt\\n"; } #$Payment_due = $Temp; if ($Payment_due eq ""){ $Payment_due = "199.00"; } # Mike test hard set amount due #$Payment_due="1.00"; &GETEXPRESSCONFIG; if ($Payment_description ne ""){ $Payment_description =~ s/ /\%20/g; } $APIrequest = "&METHOD=DoExpressCheckoutPayment&TOKEN=".$ECToken."&PAYERID=".$PayerID."&AMT=$Payment_due&DESC=".$Payment_description."&PAYMENTACTION=Sale"; &GETAPIDETAILS; exit; } else { print "Content-type: text/html\n\n"; print "Bob"; } } ############################################################################################################################################################################# sub printGetExpressCheckoutDetailsResponse { #my $Sql_cookie = $cgi->cookie('gotacres.compp'); #my @cookied = split (/\:/ , $Sql_cookie); #$User_id = $cookied[0]; #$Auction_id = $cookied[1]; #$tempfile = "$User_id"."$Auction_id"."temp.txt"; #open (TEMP, "temp/$tempfile") || die; #until (eof (TEMP)){ # $Temp = ; # chop $Temp; #} #$Payment_due = $Temp; #if ($Payment_due eq ""){ # $Payment_due = "199.00"; #} push @cookies, $cgi->cookie(-name=>'gotacres.compp', -value=>($Thissession), -expires=>'+1h'); print $cgi->header(-cookie=>[@cookies]); # ======================= # GET EXPRESS CHECKOUT DETAILS # ======================== # example URL to call this API # http://HOST/cgi-bin/poneal/NVP_perl/nvp.cgi?call=GetECDetails&UseSandbox=Y&token=EC-26S59879GF259703V&PayerID=TQX4Q4S9ZFQ7L #$APIrequest = uri_escape("&METHOD=GetExpressCheckoutDetails&TOKEN=".$ECToken); #$APIrequest = "&METHOD=GetExpressCheckoutDetails&TOKEN=".$ECToken; $thisbutton = ""; #print "Click here to conplete the Express Checkout Payment"; $buyerPayerId = $variable{'PAYERID'}; open (HEAD, "gothead.pp"); until (eof (HEAD)){ $Head = ; chop $Head; print "$Head\n"; } close HEAD; print "

                                                    Authorize Payment - Last step!

                                                    \n"; print "

                                                    PayPal® has verified your details. Click the button below to authorize your payment of \$$Payment_due.

                                                    \n"; print "

                                                    "; #print "

                                                    $thisbutton Bob

                                                    \n"; open (FOOT, "gotfoot.pp"); until (eof (FOOT)){ $Foot = ; chop $Foot; print "$Foot\n"; } } ############################################################################################################################################################################### sub printDoExpressCheckoutPaymentResponse { my $Sql_cookie = $cgi->cookie('gotacres.compp'); my @cookied = split (/\:/ , $Sql_cookie); $User_id = $cookied[0]; $Auction_id = $cookied[1]; $tempfile = "$User_id"."$Auction_id"."temp.txt"; open (TEMP, "temp/$tempfile") || die; until (eof (TEMP)){ $Temp = ; chop $Temp; @temp1 = split (/\\/ , $Temp); } $updated = 0; require "../../got_data/gotacresql.pl"; &SQLVAR; $dbh = DBI->connect("DBI:mysql:database=$db_name;host=$db_host", $db_user, $db_pass, {'RaiseError' => 1}); until ($updated >= $tempcount){ $updated++; $updateset = "high_bidder='$User_id'"; $sth = $dbh->prepare("UPDATE geodesic_auctions SET $updateset WHERE id='$Auction_id[$updated]'"); $sth->execute(); } $leglcnt = 0; until ($leglcnt >= $tempcount){ $leglcnt++; $Where_this = "WHERE id = \"$Auction_id[$leglcnt]\" AND live='0'"; $sth = $dbh->prepare("SELECT * FROM geodesic_auctions $Where_this"); $sth->execute(); $ref = $sth->fetchrow_hashref; $This_seller[$leglcnt] = $ref->{'seller'}; $Mikes = $ref->{'description'}; $Mike_hash_in = $Mikes; &GETMIKEHASH; @descript = split (/\/ , $Mike_hash_in); $Legal = $descript[4]; $Legal =~ s/\//g; $Legal =~ s/\<\/STRONG\>//g; $Legal =~ s/\<\/P\>//g; $Legal =~ s/Legal: //g; $Legal =~ s/Legal://g; $Legal =~ s/\//gi; $Legal =~ s/\<\/u\>//gi; $Legal[$leglcnt] = $Legal; @sold1 = split (/Price:/ , $Mike_hash_in); @sold2 = split (/\)/ , $sold1[1]); $This_price = $sold2[0]; $This_price =~ s/\<\/u\>//ig; $This_price =~ s/\<\/strong\>//ig; $This_price .= ")"; $Sell_price[$leglcnt] = $This_price; $updateset = "high_bidder='$User_id'"; $sth = $dbh->prepare("UPDATE geodesic_auctions SET $updateset WHERE id = \"$Auction_id[$leglcnt]\" AND live='0'"); $sth->execute(); $sth = $dbh->prepare("SELECT * FROM geodesic_auctions_userdata WHERE id='$This_seller[$leglcnt]'"); $sth->execute(); $ref = $sth->fetchrow_hashref; $This_seller_name[$leglcnt] = "$ref->{'firstname'} $ref->{'lastname'}"; $This_seller_email[$leglcnt] = $ref->{'email'}; } &SENDCUSTOMEREMAIL; $notdoug=0; until ($notdoug >= $tempcount){ $notdoug++; if ($This_seller_name ne "Doug Caffey"){ &TELLTHISSELLERTHISAUCTION; } } $Tell_who = "Doug Caffey"; $Tell_who_email = "dougcaffey\@gotacres.com"; &SENDGOTACRESEMAIL; $Tell_who = "Dena Willmon"; $Tell_who_email = "klj929598\@aol.com"; &SENDGOTACRESEMAIL; open (MAIL,"|/usr/sbin/sendmail -f webmaster\@gotacres.com 7147428374\@vtext.com"); #open (MAIL,"|/usr/sbin/sendmail -f webmaster\@gotacres.com 7146056700\@mymetropcs.com"); print MAIL "From: GotAcres\n"; print MAIL "To: Doug\n"; if ($Payment_type eq "Both"){ print MAIL "Subject: Doc fee & win bid rcvd!\n\n"; } else { print MAIL "Subject: Doc fee recvd!\n\n"; } if ($tempcount >1){ print MAIL "Title Det 4 more than 1 Dena told\n"; } else { print MAIL "Title Det 4 $Parcel_number[1] Dena told\n"; } close MAIL; $Tell_who = "Michael Diatalevi"; $Tell_who_email = "webmaster\@gotacres.com"; &SENDGOTACRESEMAIL; close TEMP; system "rm temp/$tempfile"; push @cookies, $cgi->cookie(-name=>'gotacres.compp', -value=>(), -expires=>'+1'); print $cgi->header(-cookie=>[@cookies]); open (HEAD, "gothead.pp"); until (eof (HEAD)){ $Head = ; chop $Head; if ($Head =~ /\GotAcres.com&\#174\;/){ print "GotAcres.com® - Successfull Checkout!\n"; } print "$Head\n"; } close HEAD; print "

                                                    Success!

                                                    \n"; print "Congratulations! You have successfully completed the checkout process and your details have been received. Your documents will be sent via Fedex®,\n"; print "usually within 72 hours. We have also sent a confirmation email to the address provided during checkout which includes the complete details.

                                                    \n"; print "

                                                    Thank You!

                                                    \n"; open (FOOT, "gotfoot.pp"); until (eof (FOOT)){ $Foot = ; chop $Foot; print "$Foot\n"; } } ############################################################################################################################################################################### sub SENDCUSTOMEREMAIL { open (MAIL,"|/usr/sbin/sendmail -f dougcaffey\@gotacres.com $Contact_email[1]"); #open (MAIL,"|/usr/sbin/sendmail -f webmaster\@gotacres.com webmaster\@gotacres.com"); print MAIL "From: Doug Caffey \n"; print MAIL "To: $Title_name[1] <$Contact_email[1]>\n"; if ($tempcount ==1){ print MAIL "Subject: Title details for $Parcel_number[1]!\n\n"; print MAIL "Here are the title details for auction # $Auction_id[1] ($Title[1])\n\n"; } else { print MAIL "Subject: Title details for completed auctions!\n\n"; } $mailed1=0; $Check_amount=0; until ($mailed1 >= $tempcount){ $mailed1++; if ($tempcount >1){ print MAIL "Here are the title details for auction # $Auction_id[$mailed1] ($Title[$mailed1])\n\n"; } print MAIL "The parcel number for this auction was $Parcel_number[$mailed1].\n\n"; print MAIL "Title documents will be made as follows:\n\n"; print MAIL "Name : $Title_name[$mailed1]\n"; print MAIL "Address 1 : $Addressa[$mailed1]\n"; if ($Addressb[$mailed1] ne ""){ print MAIL "Address 2 : $Addressb[$mailed1]\n"; } print MAIL "City : $City[$mailed1]\n"; print MAIL "State/Region : $State[$mailed1]\n"; print MAIL "Zip/Postal Code: $Zip_postal[$mailed1]\n"; print MAIL "Country : $Country[$mailed1]\n\n"; if ($Amount[$mailed1] == 199){ $Check_amount = $Check_amount+$Winning_bid[$mailed1]; } print MAIL "------------------------------------------------------------------------------------\n"; } print MAIL "\n"; if ($Check_amount >0){ print MAIL "Amount due to be returned with documents (check or money order): \$$Check_amount\n\n"; } print MAIL "Please allow up to 72 hours for your documents to be sent.\n\n"; print MAIL "If you have any questions please call me toll free at 800-421-7163 or outside the U.S. at 714-435-0324.\n\n"; print MAIL "Yours sincerely,\n\n"; print MAIL "Doug Caffey\n\n"; close MAIL; } ############################################################################################################################################################################### sub SENDGOTACRESEMAIL { open (MAIL,"|/usr/sbin/sendmail -f webmaster\@gotacres.com $Tell_who_email"); #open (MAIL,"|/usr/sbin/sendmail -f webmaster\@gotacres.com webmaster\@gotacres.com"); print MAIL "From: Webmaster \n"; print MAIL "To: $Tell_who_name <$Tell_who_email>\n"; if ($tempcount ==1){ print MAIL "Subject: Title details for $Parcel_number[1]!\n\n"; print MAIL "Here are the title details for auction # $Auction_id[1] ($Title[1])\n\n"; } else { print MAIL "Subject: Title details for completed auctions!\n\n"; } $mailed1=0; until ($mailed1 >= $tempcount){ $mailed1++; if ($tempcount >1){ print MAIL "Here are the title details for auction # $Auction_id[$mailed1] ($Title[$mailed1])\n"; print MAIL "Link to auction: http://www.gotacres.com/auction/index.php?a=2&b=$Auction_id[$mailed]\n\n"; } print MAIL "The parcel number for this auction was $Parcel_number[$mailed1].\n\n"; print MAIL "The price of this parcel was $Sell_price[$mailed1].\n\n"; print MAIL "Title documents should be made as follows:\n\n"; print MAIL "Name : $Title_name[$mailed1]\n"; print MAIL "Address 1 : $Addressa[$mailed1]\n"; if ($Addressb[$mailed1] ne ""){ print MAIL "Address 2 : $Addressb[$mailed1]\n"; } print MAIL "City : $City[$mailed1]\n"; print MAIL "State/Region : $State[$mailed1]\n"; print MAIL "Zip/Postal Code: $Zip_postal[$mailed1]\n"; print MAIL "Country : $Country[$mailed1]\n\n"; print MAIL "------------------------------------------------------------------------------------\n"; } print MAIL "\n"; if ($Check_amount >0){ print MAIL "Amount due to be returned with documents (check or money order): \$$Check_amount. Only the document fee has been paid.\n\n"; } else { print MAIL "They paid \$$Payment_due at PayPal, which included their winning bid"; if ($mailed1 >1){ print MAIL "s"; } else { print MAIL " (\$$Winning_bid[$mailed1]) "; } print MAIL " and document fee"; if ($mailed1 >1){ print MAIL "s"; } else { print MAIL " (\$199.00)"; } print MAIL ".\n"; } $mailed1=0; if ($Check_amount ==0 && $tempcount >1){ print MAIL "\n"; print MAIL "Payment breakdown:\n\n"; until ($mailed1 >= $tempcount){ $mailed1++; print MAIL "Parcel # $Parcel_number[$mailed1]: Winning bid: \$$Winning_bid[$mailed1] Document Fee: \$199.00\n"; } } print MAIL "Bonus information: This person came via $Bonus_information"; if ($Bonus_other ne ""){ print MAIL " ($Bonus_other)"; } print MAIL ".\n"; close MAIL; } ############################################################################################################################################################################### sub TELLTHISSELLERTHISAUCTION { open (MAIL,"|/usr/sbin/sendmail -f webmaster\@gotacres.com $This_seller_email[$notdoug]"); print MAIL "From: Michael Diatalevi \n"; print MAIL "To: $This_seller_name[$notdoug] <$This_seller_email[$notdoug]>\n"; print MAIL "Subject: Title details for $Parcel_number[$notdoug]!\n\n"; print MAIL "Here are the title details for auction # $Auction_id[$notdoug] ($Title[$notdoug])\n\n"; print MAIL "The parcel number for this auction was $Parcel_number[$notdoug].\n\n"; print MAIL "Title documents should be made as follows:\n\n"; print MAIL "Name : $Title_name[$notdoug]\n"; print MAIL "Address 1 : $Addressa[$notdoug]\n"; if ($Addressb[$notdoug] ne ""){ print MAIL "Address 2 : $Addressb[$notdoug]\n"; } print MAIL "City : $City[$notdoug]\n"; print MAIL "State/Region : $State[$notdoug]\n"; print MAIL "Zip/Postal Code: $Zip_postal[$notdoug]\n"; print MAIL "Country : $Country[$notdoug]\n\n"; if ($Check_amount==0){ print MAIL "Amount due to be returned with documents (check or money order): \$$Winning_bid[$notdoug]. Only the document fee has been paid.\n\n"; } else { $This_payment = $Winning_bid[$notdoug]+199; print MAIL "They paid \$$This_payment at PayPal, which included their winning bid"; print MAIL " (\$$Winning_bid[$mailed1]) "; print MAIL " and document fee"; print MAIL " (\$199.00)"; print MAIL ".\n\n"; } print MAIL "Listed price of land: $Sell_price[$notdoug]\n\n"; print MAIL "Bonus information: $Bonus_information"; if ($Bonus_other ne ""){ print MAIL " ($Bonus_other)"; } print MAIL ".\n"; close MAIL; } ############################################################################################################################################################################### #my $SBAPIusername = "webmas_1219854196_biz_api1.gotacres.com"; #my $SBAPIpassword = "1219854201"; #my $SBAPIsignature = "An5ns1Kso7MWUdW4ErQKJJJ4qi4-AdDqIYNQEUbHwOh0SOrRuiq.G55y"; #my $SBAPISubject = ""; #my $SandboxURL = "https://api-3t.sandbox.paypal.com/nvp"; #219937601 #webmas_1219875637_per@gotacres.com