Jump to content

Fedex Integration Success


jeet_0077

Recommended Posts

Hi,

i have posted before too and got some clue from the reply. Here is my progress

 

here is the link http://www.kaplanmd.com/fedextest/fedec.php

 

 

If you can go the link provided for the test site you can see that it is returning value for the Fedex ground but nothing for the other two in case of US Customers.

 

I am also printing the error but for the above case it showing no error but also not showing any price.

If you have any idea why this is happening

 

Apart from that if some one knows how to integrate the

1.Internal priority express and

2.International Economy

 

For the above I was not able provide the proper tags although I have downloaded the tag documentations from the Fedex website.

 

Here is my code: this code can be really useful once I finish the total integration.

 

include('fedexdc.php');

 

if ($_POST['uSubmit']!=""){

// create new fedex object

$fed = new FedExDC('*******','********');

$sType = $_POST['sType'];

switch($sType)

{

case "FGround" : $carrCode = "FDXG";

$servType = "92";

break;

case "F2day" :  $carrCode = "FDXE";

$servType = "03";

break;

case "Fovernite" : $carrCode = "FDXE";

$servType = "05";

break;

case "Fintprio" : $carrCode = "FDXE";

$servType = "70";

break;

case "Finteco" : $carrCode = "FDXE";

$servType = "86";

break;

}

 

 

$ship_data = array(

75=>  'LBS'            // Weight Units Valid weight types: • LBS • KGS  Must be LBS on a U.S. rate quote.

 

,16=>  'Ma'        //Recipient State.Required only if Recipient Country Code is US or CA.Represents the state or province                            to which the shipment is destined.

 

,13=>  '44 Main street' // Recipient Address Line 1. Primary address line to which the shipment is destined.

 

,5=>    '435 N. Roxbury Drive' //Sender Address Line 1 . Primary address line from which the shipment is originating.

 

,1273=> '01'  //Packaging Type. FedEx Express shipping packaging types are: 01 – Other packaging 02 – FedEx Pak 03 – FedEx                        Box 04 – FedEx Tube 06 – FedEx Envelope 15* – FedEx 10kg Box (international only) 25* – FedEx 25kg Box                      (international only) FedEx Ground shipping packaging types are: 01 – Customer packaging    Defaults to 01                        if not specified.

 

,1274=> $servType // Service Type. List available in Fedex documentation PDF file. Page  No: 231

 

 

,18=>  '6173335555' //Recipient Phone Number. Phone number for the contact person to whom the shipment is destined.The                            maximum length is 10 for US and CA, 15 for all other countries. Do not include embedded special                            characters.

 

,15=>  'Boston' // Recipient City. Name of the city to which the shipment is destined.A minimum of 3 alpha characters must                            be passed.

 

,23=>  '1' //Pay Type.Only Bill Sender and Bill Third Party are allowed. Valid payment types are: 1 = Bill sender                    (Prepaid) 2 = Bill recipient (for FedEx Express); Collect (for FedEx Ground) 3 = Bill third party 5 = Bill                      recipient for FedEx Ground

 

,9=>    '90210' // Sender Postal Code. Required only if Sender Country Code is US or CA. Postal code may also be required                          for other postal-aware countries. Represents the postal code from which the shipment will be                          originating.Valid characters: A-Z; 0-9; a-z

 

,183=>  '3103955006' // Sender Phone Number. The phone number of the person initiating the shipment.The maximum length is                              10 for US and CA, 16 for all other countries. Do not include. embedded special characters.

 

,8=>    'CA' //Sender State.Required only if Sender Country Code is US or CA.

 

,117=>  'US' //Sender Country Code. Represents the country from which the shipment will be originating.

 

,17=>  '02116'//Recipient Postal Code.Required only if Recipient Country Code is US or CA.Postal code may also be required                        for other postal-aware countries.Represents the postal code to which the shipment is destined.Valid                        characters: A-Z; 0-9; a-z

 

,50=>  'US' //  Recipient Country Code.Represents the country code to which the shipment is destined.

 

,4=>    'Kaplan MD'//Sender Company.Required if the sender contact name is not passed in the transaction.If included in the                            transaction, a minimum of 3 alpha characters must be passed.

 

,7=>    'Beverly Hills'//Sender City. City name from which the shipment is originating. Minimum of 3 alpha characters must                                  be passed for shipping.

 

,1369=> '1' //Label Printer Type. Required to indicate label formatting.Valid values: 1 = Laser printer    2 = Eltron Orion                    (EPL2)      3 = Eltron Eclipse (EPL2)        4 = Zebra ZPL and ZPL II    5 = Unimark

 

,12=>  'Jay Powers' //Recipient Contact Name. Required if Recipient Company Name was not passed in the Request transaction                              and COD service is selected. If passed in the transaction, a minimum of 3 alpha characters must be                              passed.

 

,1333=> '1'  //Drop Off Type. Valid values: 1 if regular pickup  2 if request courier 3 if drop box  4 if drop at BSC  5 if                      drop at station.  Only 1 (regular pickup), 2 (request courier), or 5 (drop at station) are allowed with                      international freight shipping.

 

,1401=> '3.0' //Total Package Weight/Shipment total weight. This is used for actual piece weight only, not total shipment                      weight.

 

,116 => 1//Package Total(Total Number of Pieces)

 

,68 =>  'USD'//Customs/Declared Value Currency Type

 

,1368 => 1 //Label Type. 2 = 2D Common

//,1369 => 1

,1370 => 5 // Label Media Type

 

,3025 => $carrCode // Carrier Code.          Valid values:FDXE – FedEx Express    FDXG – FedEx Ground

 

,1119 =>'N' //Future Day Shipment. Y if shipment is future day.

 

,99 =>"" // Transaction end

);

 

// Ship example

$ship_Ret = $fed->ship_express($ship_data);

 

if ($error = $fed->getError()) {

echo "ERROR :". $error;

} else {

// Save the label to disk

$fed->label('mylabel.png');

 

}

}

 

/* tracking example

 

$track_Ret = $fed->track(

array(

    29 => 790344664540,

));

 

*/

 

 

 

echo $fed->debug_str. "\n<BR>";

echo "Surcharge ".$ship_Ret[1417]. "\n<BR>"; 

echo "Price ".$ship_Ret[1419];

 

 

 

?>

<table>

<form method="post" action="">

<tr>

<td>US Customers :</td>

<td>  </td>

<td><input type="radio" name="sType" value="FGround">  Fedex Ground</td>

</tr>

<tr>

<td>  </td>

<td>  </td>

<td><input type="radio" name="sType" value="F2day">  Fedex 2 Day Express</td>

</tr>

<tr>

<td>  </td>

<td>  </td>

<td><input type="radio" name="sType" value="Fovernite">  Fedex Overnight Express</td>

</tr>

<tr>

<td>International Customers :</td>

<td>  </td>

<td><input type="radio" name="sType" value="Fintprio">  International Priority Express</td>

</tr>

<tr>

<td>  </td>

<td>  </td>

<td><input type="radio" name="sType" value="Finteco">  International Economy</td>

</tr>

 

<tr>

<td>

<input type="submit" name="uSubmit" value="Calculate">

</td>

</tr>

</form>

</table>

Link to comment
https://forums.phpfreaks.com/topic/56325-fedex-integration-success/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.