Incorporating the PERL script

Get help with nopcart Perl, PHP or ASP checkout related issues.

Moderators: Koibito, Stefko, Randy

Incorporating the PERL script

Postby Anastasiya » Mon Jan 11, 2010 5:32 pm

Hello,
Could you please, help me to establish a correct connection between the checkout.pl script and FirstData payment processor?
There is the problem:
1) If to incert the "checkout.pl" link into the "action" tag of the order form of the "checkout.html" page - everything works fine. It sends order emails and updates the .csv file. Credit card data can be captured and sent as well. However it is unsecure.

2) If to incert the "https://secure.linkpt.net/lpcentral/servlet/lppay" link into the same "action" tag - it connects to the FirstData and processes the credit card. However, it disconnects the checkout.pl script and order information cannot be delivered.

3) I tryed to separate order and credit card forms into different pages and include corresponding links into their "action" tags. But it does not work.

4) I tryed to include the "https://secure.linkpt.net/lpcentral/servlet/lppay" link into the "checkout.pl" file and it also does not work.

How to establish a connection to the FirstData after a user submits an order information?

Thanks,
Anastasiya
WebMaster
 
Posts: 17
Joined: Wed Oct 21, 2009 6:27 pm

Re: Incorporating the PERL script

Postby Stefko » Wed Jan 13, 2010 2:40 am

Paste this in the bottom of your checkout.pl script to replace the thankyou text:

Code: Select all
print qq~
<html>
<head>
<title>Processing Order</title>
 <script language=javascript>
function load(){
setTimeout("submit_psi()",3000);
}
function submit_psi(){
var form = document.processor;
form.submit();
}
</script>
</head>
<body bgcolor="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="load();">
<center><font color="#FFFFFF">Processing ....</font></center>

<form method="POST" name="processor" action="$formaction">
<input type="hidden" name="storename" value="$storename">
<input type="hidden" name="mode" value="$PaymentMode">
<input type="hidden" name="bname" value="$bname">
<input type="hidden" name="baddr1" value="$b_addr1">
<input type="hidden" name="bcity" value="$b_city">
<input type="hidden" name="bstate" value="$b_state">
<input type="hidden" name="bzip" value="$b_zip">
<input type="hidden" name="sname" value="$s_name">
<input type="hidden" name="saddr1" value="$s_addr1">
<input type="hidden" name="scity" value="$s_city">
<input type="hidden" name="sstate" value="$s_state">
<input type="hidden" name="szip" value="$s_zip">
<input type="hidden" name="phone" value="$b_phone">
<input type="hidden" name="email" value="$b_email">
<input type="hidden" name="subtotal" value="$subtotal">
<input type="hidden" name="shipping" value="$shipping">
<input type="hidden" name="tax" value="$tax">
<input type="hidden" name="chargetotal" value="$chargetotal">

         </TD>
    </TR>

</TABLE>
</body>
</html>
~;


exit;
KFL Technologies
Web-Enabled Solutions
e-Commerence Solutions
Stefko
Contributor / Guru
 
Posts: 833
Joined: Wed Sep 18, 2002 1:11 am
Location: Wichita, KS

Re: Incorporating the PERL script

Postby Anastasiya » Mon Jan 18, 2010 5:34 pm

Thank you! I resolved this problem.
Anastasiya
WebMaster
 
Posts: 17
Joined: Wed Oct 21, 2009 6:27 pm

Re: Incorporating the PERL script

Postby lesliekirk » Tue Feb 02, 2010 3:33 am

Need a huge point of clarification on how to do this. Do I replace ALL of this:

Code: Select all
print "Content-type: text/html\n\n";

open (HEAD, $header);
@LINES = <HEAD>;
close HEAD;
print @LINES;

print "<h2>Thank you</h2>";
print "Thank you for your order from our online store.  You will receive a confirmation email of your order ";
print "momentarily.  Please contact us at $youremail if you have any questions or concerns.";
print "<P>";
print "<A HREF=\"$returnpage\" target=_top>Return Home</A>";
print "<P>";

open (FOOT, $footer);
@LINES = <FOOT>;
close FOOT;

print @LINES;

exit;


If so, it's not working as I would have thought - it display all the code. Where is the closing FORM tag? And it looks like there is some table tags that don't belong.

Stefko wrote:Paste this in the bottom of your checkout.pl script to replace the thankyou text:

Code: Select all
print qq~
<html>
<head>
<title>Processing Order</title>
 <script language=javascript>
function load(){
setTimeout("submit_psi()",3000);
}
function submit_psi(){
var form = document.processor;
form.submit();
}
</script>
</head>
<body bgcolor="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="load();">
<center><font color="#FFFFFF">Processing ....</font></center>

<form method="POST" name="processor" action="$formaction">
<input type="hidden" name="storename" value="$storename">
<input type="hidden" name="mode" value="$PaymentMode">
<input type="hidden" name="bname" value="$bname">
<input type="hidden" name="baddr1" value="$b_addr1">
<input type="hidden" name="bcity" value="$b_city">
<input type="hidden" name="bstate" value="$b_state">
<input type="hidden" name="bzip" value="$b_zip">
<input type="hidden" name="sname" value="$s_name">
<input type="hidden" name="saddr1" value="$s_addr1">
<input type="hidden" name="scity" value="$s_city">
<input type="hidden" name="sstate" value="$s_state">
<input type="hidden" name="szip" value="$s_zip">
<input type="hidden" name="phone" value="$b_phone">
<input type="hidden" name="email" value="$b_email">
<input type="hidden" name="subtotal" value="$subtotal">
<input type="hidden" name="shipping" value="$shipping">
<input type="hidden" name="tax" value="$tax">
<input type="hidden" name="chargetotal" value="$chargetotal">

         </TD>
    </TR>

</TABLE>
</body>
</html>
~;


exit;


Many thanks!
Leslie
lesliekirk
WebMaster
 
Posts: 15
Joined: Thu Jan 28, 2010 10:01 pm

Re: Incorporating the PERL script

Postby Stefko » Tue Feb 02, 2010 1:54 pm

correct, but leave in this line:

Code: Select all
print "Content-type: text/html\n\n";


As for the end form tag, sure put that in, and remove the extra tags </td> and <tr> ( this was cut from a clients script )

IF your seeing Code then contact your host, it sounds like you don't have CGI enabled on the system
KFL Technologies
Web-Enabled Solutions
e-Commerence Solutions
Stefko
Contributor / Guru
 
Posts: 833
Joined: Wed Sep 18, 2002 1:11 am
Location: Wichita, KS

Re: Incorporating the PERL script

Postby lesliekirk » Tue Feb 02, 2010 2:34 pm

Thanks, I'll give it a shot. I think CGI is enabled because the checkout.pl functioned before tried adding that code. The problem is that it's not adding to the CSV file or sending the Order Confirmation to the store order. The only email that is being sent is the Order Confirmation to the customer.
lesliekirk
WebMaster
 
Posts: 15
Joined: Thu Jan 28, 2010 10:01 pm

Re: Incorporating the PERL script

Postby Stefko » Tue Feb 02, 2010 2:49 pm

check the setting MODE, sounds like there is where the problem lies.
KFL Technologies
Web-Enabled Solutions
e-Commerence Solutions
Stefko
Contributor / Guru
 
Posts: 833
Joined: Wed Sep 18, 2002 1:11 am
Location: Wichita, KS

Re: Incorporating the PERL script

Postby lesliekirk » Tue Feb 02, 2010 3:28 pm

MODE is set to BOTH - has been all along.
lesliekirk
WebMaster
 
Posts: 15
Joined: Thu Jan 28, 2010 10:01 pm

Re: Incorporating the PERL script

Postby lesliekirk » Tue Feb 02, 2010 8:25 pm

I just tried something - I removed the path to scripts/nopcart.js and the checkout.pl now posts to the CSV file and send an email to the store own albeit WITHOUT the CheckoutCart(); data because it's not there to pass on.

So would the problem still be something in the checkout.pl or is it something in the nopcart.js - my first thought would be the nopcart.js but could there be some inter-dependence that I'm overlooking?

Thanks,
Leslie
lesliekirk
WebMaster
 
Posts: 15
Joined: Thu Jan 28, 2010 10:01 pm

Re: Incorporating the PERL script

Postby Stefko » Tue Feb 02, 2010 10:50 pm

your issue is definitely with the nopcart.js file, see what data is being passed to the checkout page before submitting to the checkout.pl file

You can post or pm a link to your shop, that may help trouble-shooting this issue.
KFL Technologies
Web-Enabled Solutions
e-Commerence Solutions
Stefko
Contributor / Guru
 
Posts: 833
Joined: Wed Sep 18, 2002 1:11 am
Location: Wichita, KS

Re: Incorporating the PERL script

Postby Anastasiya » Fri Feb 05, 2010 7:06 pm

There is a path to the shopping cart: https://www.jlisandra.com/scripts/nopcart.js
Anastasiya
WebMaster
 
Posts: 17
Joined: Wed Oct 21, 2009 6:27 pm


Return to Help: Perl/PHP/ASP Checkout

Who is online

Users browsing this forum: No registered users and 2 guests

cron