custom shipping cgi

General ShopSite user discussion

custom shipping cgi

Postby JerryC » Mon Oct 31, 2005 7:01 pm

Hi all!

I am frustrated over this issue. I dont know if this is the best place to
post this. I am trying to use a custon cgi script for shipping calculations.
The example in the ver. 7 pro documentation, does not work as is. I had to
add:

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

just to get the server not to error out. In addition i created the following
script just to test it. this is it:
#---------------------------------------------------------------------
#!/usr/bin/perl
print "Content-type: text/html\n\n";
$total=3;
print "status=pass\n";
print "option_count=3\n";
print "s1option=API%20Ground\n";
printf ("s1price=%0.2f\n",1.00*$total);
print "s2option=API%20Next%20Week\n";
printf ("s2price=%0.2f\n",2.00*$total);
print "s3option=API%20Tomorrow\n";
printf ("s3price=%0.2f\n",4.00*$total);
#------------------------------------------------------------------------

This fulfills the specs as outlined in the documentation found at:
http://www.shopsite.com/help/7.1/en-US/ ... pping.html
(navigate to Shipping API Specification)
In fact my script is a cut and paste from shopsites spec page example. But I
get a response from the shopping cart:
Error

--------------------------------------------------------------------------------

ShopSite detected that the information passed from the Custom Shipping
Add-on is incomplete and cannot be processed.



--------------------------------------------------------------------------------


Can anyone here help me?
If so thanx up front!

JerryC
JerryC
 

Re: custom shipping cgi

Postby loren_d_c » Tue Nov 01, 2005 9:12 am

There is more to consider when creating a custom script than just the
content of it. There are permissions and ownership issues (needs execute
permissions and shouldn't b owned by root, for example), the format you
FTP the script to the server could be an issue (you should always FTP
scripts in ASCII/Text format so that the transfer can convert them to
the right text file format for your server), the location of the Perl
executable on your system (indicated by the first line in the file) may
not be correct, etc etc.

Also, you should not need the 'print "Content-type: text/html\n\n";' in
there when it is being executed by the ShopSite custom shipping api. You
would only have to have it if you were executing the script itself
directly from your browser.

-Loren



JerryC wrote:
Hi all!

I am frustrated over this issue. I dont know if this is the best place to
post this. I am trying to use a custon cgi script for shipping calculations.
The example in the ver. 7 pro documentation, does not work as is. I had to
add:

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

just to get the server not to error out. In addition i created the following
script just to test it. this is it:
#---------------------------------------------------------------------
#!/usr/bin/perl
print "Content-type: text/html\n\n";
$total=3;
print "status=pass\n";
print "option_count=3\n";
print "s1option=API%20Ground\n";
printf ("s1price=%0.2f\n",1.00*$total);
print "s2option=API%20Next%20Week\n";
printf ("s2price=%0.2f\n",2.00*$total);
print "s3option=API%20Tomorrow\n";
printf ("s3price=%0.2f\n",4.00*$total);
#------------------------------------------------------------------------

This fulfills the specs as outlined in the documentation found at:
http://www.shopsite.com/help/7.1/en-US/ ... pping.html
(navigate to Shipping API Specification)
In fact my script is a cut and paste from shopsites spec page example. But I
get a response from the shopping cart:
Error

--------------------------------------------------------------------------------

ShopSite detected that the information passed from the Custom Shipping
Add-on is incomplete and cannot be processed.



--------------------------------------------------------------------------------


Can anyone here help me?
If so thanx up front!

JerryC

loren_d_c
 
Posts: 2569
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Re: custom shipping cgi

Postby JerryC » Tue Nov 01, 2005 2:43 pm

Ok thanx
chmod is correct,
the CRLF issue is correct. FTP is not the problem
Ownership is correct. I am familiar with all these issues and have addressed
them.
perl location is correct.

What you say about the content type tho may be something. I added the line
to the script because i was testing it it from the browser.
I am a vb applications programmer and perl is new to me. I will try removing
the content type line and test through shopsite.

Thanx for your response. Ill let you know

Jerry C



"Loren" <loren_d_c@yahoo.com> wrote in message
news:dk80kd$nf8$1@eval.shopsite.com...
There is more to consider when creating a custom script than just the
content of it. There are permissions and ownership issues (needs execute
permissions and shouldn't b owned by root, for example), the format you
FTP the script to the server could be an issue (you should always FTP
scripts in ASCII/Text format so that the transfer can convert them to the
right text file format for your server), the location of the Perl
executable on your system (indicated by the first line in the file) may
not be correct, etc etc.

Also, you should not need the 'print "Content-type: text/html\n\n";' in
there when it is being executed by the ShopSite custom shipping api. You
would only have to have it if you were executing the script itself
directly from your browser.

-Loren



JerryC wrote:
Hi all!

I am frustrated over this issue. I dont know if this is the best place to
post this. I am trying to use a custon cgi script for shipping
calculations.
The example in the ver. 7 pro documentation, does not work as is. I had
to add:

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

just to get the server not to error out. In addition i created the
following script just to test it. this is it:
#---------------------------------------------------------------------
#!/usr/bin/perl
print "Content-type: text/html\n\n";
$total=3;
print "status=pass\n";
print "option_count=3\n";
print "s1option=API%20Ground\n";
printf ("s1price=%0.2f\n",1.00*$total);
print "s2option=API%20Next%20Week\n";
printf ("s2price=%0.2f\n",2.00*$total);
print "s3option=API%20Tomorrow\n";
printf ("s3price=%0.2f\n",4.00*$total);
#------------------------------------------------------------------------

This fulfills the specs as outlined in the documentation found at:
http://www.shopsite.com/help/7.1/en-US/ ... pping.html
(navigate to Shipping API Specification)
In fact my script is a cut and paste from shopsites spec page example.
But I get a response from the shopping cart:
Error

--------------------------------------------------------------------------------

ShopSite detected that the information passed from the Custom Shipping
Add-on is incomplete and cannot be processed.



--------------------------------------------------------------------------------


Can anyone here help me?
If so thanx up front!

JerryC
JerryC
 

Re: custom shipping cgi

Postby JerryC » Tue Nov 01, 2005 2:48 pm

Loren!
Thank You Thank You Thank You!

That was it
The content type line that i had to add for browser testing, I had to remove
for production.

Thanx
JerryC


"JerryC" <JerryC@adelphia.net> wrote in message
news:dk8k0q$4f8$1@eval.shopsite.com...
Ok thanx
chmod is correct,
the CRLF issue is correct. FTP is not the problem
Ownership is correct. I am familiar with all these issues and have
addressed them.
perl location is correct.

What you say about the content type tho may be something. I added the line
to the script because i was testing it it from the browser.
I am a vb applications programmer and perl is new to me. I will try
removing the content type line and test through shopsite.

Thanx for your response. Ill let you know

Jerry C



"Loren" <loren_d_c@yahoo.com> wrote in message
news:dk80kd$nf8$1@eval.shopsite.com...
There is more to consider when creating a custom script than just the
content of it. There are permissions and ownership issues (needs execute
permissions and shouldn't b owned by root, for example), the format you
FTP the script to the server could be an issue (you should always FTP
scripts in ASCII/Text format so that the transfer can convert them to the
right text file format for your server), the location of the Perl
executable on your system (indicated by the first line in the file) may
not be correct, etc etc.

Also, you should not need the 'print "Content-type: text/html\n\n";' in
there when it is being executed by the ShopSite custom shipping api. You
would only have to have it if you were executing the script itself
directly from your browser.

-Loren



JerryC wrote:
Hi all!

I am frustrated over this issue. I dont know if this is the best place
to post this. I am trying to use a custon cgi script for shipping
calculations.
The example in the ver. 7 pro documentation, does not work as is. I had
to add:

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

just to get the server not to error out. In addition i created the
following script just to test it. this is it:
#---------------------------------------------------------------------
#!/usr/bin/perl
print "Content-type: text/html\n\n";
$total=3;
print "status=pass\n";
print "option_count=3\n";
print "s1option=API%20Ground\n";
printf ("s1price=%0.2f\n",1.00*$total);
print "s2option=API%20Next%20Week\n";
printf ("s2price=%0.2f\n",2.00*$total);
print "s3option=API%20Tomorrow\n";
printf ("s3price=%0.2f\n",4.00*$total);
#------------------------------------------------------------------------

This fulfills the specs as outlined in the documentation found at:
http://www.shopsite.com/help/7.1/en-US/ ... pping.html
(navigate to Shipping API Specification)
In fact my script is a cut and paste from shopsites spec page example.
But I get a response from the shopping cart:
Error

--------------------------------------------------------------------------------

ShopSite detected that the information passed from the Custom Shipping
Add-on is incomplete and cannot be processed.



--------------------------------------------------------------------------------


Can anyone here help me?
If so thanx up front!

JerryC

JerryC
 


Return to User Forum

Who is online

Users browsing this forum: No registered users and 49 guests

cron