Greetings All!
I've been setting up a Perl shopping cart for a friend of mine who just opened his own retail store.
My friend wants to use FedEx as a shipper... nobody else.
I checked out FedEx's site and found that most of the API's require a Windows hosting platform. Well, I've got his site out on Unix, of course.
The only other option FedEx offers is that you can call a particular URL, with parameters added on, in order to look up rate quotes, delivery times, tracking, etc. Here's a sample:
This URL triggers an executable over on FedEx's servers and kicks back a web-page that looks like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN" "<HTML>
<!--#nossi-->
<HEAD>
<TITLE>FedEx Ground Rate Calculation Reply</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#DE5208" VLINK="#9425E6" ALINK="#000000">
<font size="5" face="arial, courier new">
<i><b>FedEx Ground Rate Calculation</b></i>
</font>
<font size="-1" face="arial, courier new">
<!-- Begin Reply Message -->
<table border="0" cellpadding="0" cellspacing="5" width="440">
<TR><TD ALIGN="LEFT" VALIGN="TOP" COLSPAN="4">
<!Service>U.S. Domestic FedEx Ground Package<!/Service>
<!Origin>44429<!/Origin>
<!Destination>64050<!/Destination>
<!Zone>5<!/Zone>
<!TransitTime>3<!/TransitTime>
<!Weight>50<!/Weight>
<!BillWeight>50<!/BillWeight>
<!WeightUnit>LBS<!/WeightUnit>
<!BaseRate>15.47<!/BaseRate>
<!TotalCharges>15.47<!/TotalCharges>
</TD></TR>
</table>
<!-- End Reply Message -->
</font>
</BODY>
</HTML>
What I'd like to know is... (and I'll admit that I'm not a formally-trained Perl programmer... I just learned by tinkering)....:
1) I know I can "build" the request URL with the proper parameters from the cart, but how can I "call" the URL from within the cart/Perl script itself ?
2) And, can I somehow "capture" the response sent from the FedEx servers/exe... sort through the output... and just "take out" the info from the necessary fields that I need (rate quotes mostly), so as to plug them into the HTML output of the shopping cart properly ??
Thanks !
-= Dave Raasch =-
Independence, MO
I've been setting up a Perl shopping cart for a friend of mine who just opened his own retail store.
My friend wants to use FedEx as a shipper... nobody else.
I checked out FedEx's site and found that most of the API's require a Windows hosting platform. Well, I've got his site out on Unix, of course.
The only other option FedEx offers is that you can call a particular URL, with parameters added on, in order to look up rate quotes, delivery times, tracking, etc. Here's a sample:
This URL triggers an executable over on FedEx's servers and kicks back a web-page that looks like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN" "<HTML>
<!--#nossi-->
<HEAD>
<TITLE>FedEx Ground Rate Calculation Reply</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#DE5208" VLINK="#9425E6" ALINK="#000000">
<font size="5" face="arial, courier new">
<i><b>FedEx Ground Rate Calculation</b></i>
</font>
<font size="-1" face="arial, courier new">
<!-- Begin Reply Message -->
<table border="0" cellpadding="0" cellspacing="5" width="440">
<TR><TD ALIGN="LEFT" VALIGN="TOP" COLSPAN="4">
<!Service>U.S. Domestic FedEx Ground Package<!/Service>
<!Origin>44429<!/Origin>
<!Destination>64050<!/Destination>
<!Zone>5<!/Zone>
<!TransitTime>3<!/TransitTime>
<!Weight>50<!/Weight>
<!BillWeight>50<!/BillWeight>
<!WeightUnit>LBS<!/WeightUnit>
<!BaseRate>15.47<!/BaseRate>
<!TotalCharges>15.47<!/TotalCharges>
</TD></TR>
</table>
<!-- End Reply Message -->
</font>
</BODY>
</HTML>
What I'd like to know is... (and I'll admit that I'm not a formally-trained Perl programmer... I just learned by tinkering)....:
1) I know I can "build" the request URL with the proper parameters from the cart, but how can I "call" the URL from within the cart/Perl script itself ?
2) And, can I somehow "capture" the response sent from the FedEx servers/exe... sort through the output... and just "take out" the info from the necessary fields that I need (rate quotes mostly), so as to plug them into the HTML output of the shopping cart properly ??
Thanks !
-= Dave Raasch =-
Independence, MO