Forum Moderators: open

Message Too Old, No Replies

Help Converting this script to ASP

Help Converting this script to ASP

         

lindajames

10:57 am on Apr 18, 2003 (gmt 0)

10+ Year Member



Hi, I have a perl script that is used for the worldpay callback response, However, I need the script to be in ASP. can anyone help me convert this to ASP so that it sends email with CDONTS?

any help would be much appreciated.

cheers
linda

#!/usr/local/bin/perl

$mail_prog = '/usr/lib/sendmail';
use CGI qw/:standard :html3 :netscape/;
$q = new CGI;

###########################
# Main Routines #
###########################

&ReadParam();
if ($TRANSSTATUS eq "Y") {
&PrintResult();
&Send_Mail();
}
else{
&PrintCancel();
}
###########################
# Parameters passed #
###########################

sub ReadParam {
$TRANSID = $q->param('transId');
$TRANSSTATUS = $q->param('transStatus');
$COMPANYID = $q->param('cartId');
$COMPANYNAME = $q->param('name');
$EXAMPLE = $q->param('M_example');
$AMOUNT = $q->param('authAmount');
$CURRENCY = $q->param('authCurrency');
$TEL = $q->param('tel');
$EMAIL = $q->param('email');
return 1;
}

###########################
# Output #
###########################

sub PrintResult {

# Print MIME header:
print header(-type=>'text/html');

print <<"PAGE";
<HTML>
<HEAD>
<TITLE> WorldPay - Result Page</TITLE>
</head>

<BODY>

<font size="2" face="verdana,arial,geneva,helvetica">
<blockquote>
<h3>Thank you for your payment your transaction details are</h3>
<p>TransID is: $TRANSID<br>
Your Company ID number: $COMPANYID<br>
Your Company name: $COMPANYNAME<br>
Example : $EXAMPLE<br>
You have paid $AMOUNT in $CURRENCY<br>
Your contact Tel number: $TEL<br>
Your contact Tel number: $EMAIL</p>
</blockquote>
</font>
</HTML>
PAGE
}

###########################
# Email #
###########################

sub Send_Mail{

#open (MAIL, "¦$mail_prog -oi -t $recip");
open (MAIL, "¦$mail_prog -oi -t");
print MAIL "To: $EMAIL\n";
print MAIL "Reply-to: $recip\n";
print MAIL "From: company@test.com\n";
print MAIL "Subject: Result Page\n\n";
print MAIL "The following transaction has been made:\n\n";
print MAIL "Transaction ID Number: $TRANSID\n" ;
print MAIL "For: $COMPANYNAME\n" ;
print MAIL "Company ID: $COMPANYID\n" ;
print MAIL "M_Example: $EXAMPLE\n" ;
print MAIL "For the ammount of $AMOUNT in $CURRENCY\n\n";
print MAIL "Contact Details:\n\n";
print MAIL "Contact Email Address: $EMAIL\n" ;
print MAIL "Contact Tel. number: $TEL\n" ;
close (MAIL);
}

###########################
# Output Cancel #
###########################

sub PrintCancel {

# Print MIME header:
print header(-type=>'text/html');

print <<"PAGE";
<HTML>
<HEAD>
<TITLE> WorldPay - Cancel Page</TITLE>
</head>

<BODY>
<font size="2" face="verdana,arial,geneva,helvetica">
<blockquote>
<h3>Your Transaction has been cancelled ...</h3>
<p>To resubmit your payment <a href="http://www.shop.com">click here</a></p>
</font>
</HTML>
PAGE
}

lindajames

11:42 am on Apr 23, 2003 (gmt 0)

10+ Year Member



doesnt matter, ive figured it out