Latest News: (loading..)
greasemonkey

FedEx - Web Services v9

685 posts in this topic

My FedEx shipping options are going most expensive to cheapest anyway to switch that so it goes from cheapest to most expensive or in descending order?

 

This may address your needs:

http://www.zen-cart.com/showthread.php?194803-FedEx-sort-order

 

Please let us know if it works with this version and post back the code you end up with...

Share this post


Link to post
Share on other sites

if anyone is using this module succesfully with Google Checkout and using Merchant Calculated Ship Methods...

 

PLEASE PLEASE post your functioning merchant_calculated_methods.php file

 

 

thank you much

Share this post


Link to post
Share on other sites

New version posted v9.4.2

http://addons.oscommerce.com/info/7977

 

v9.4.2 by Roaddoctor 5/20/2012

Changes since v9.4.1

- fixed text in Enable ready-to-ship field

- Corrected error in $show_box_weight

- fixed fatal divide by 0 error with Google Checkout

 

TO DO LIST:

- add switches for displaying item count, weight, transit days etc...

- work out issues with EXT DAS, EXT RES DAS surcharges

- add disable module limits by weight or box count

- code SmartPost into the module

- add seperate surcharge control field for freight (to apply your freight discount)

 

This is a minor bug fix update to v9.4.1. See the install.txt for upgrade instructions.

 

Please keep support questions here in the forum. Please post any issues or problems.

 

-Dave

Share this post


Link to post
Share on other sites

Hi all - thanks for the contribution and support. I just wanted to raise a couple of remaining issues that we are having.

 

1) We did experience a $0.00 shipping incident to Canada. We were using List rates. I found someone else's solution was basically to NOT use List Rates or to shut off all ground options to Canada. I'm not sure if that denial of Canada ground options has been incorporated into the newest version, but I am hoping someone can figure out why List rates occasionally fail for Canada - basically defaulting to free shipping. It's a big issue for my client, but we have no options at this point. What we have done is to use Account rates, but I programmed in the ability to adjust % increase cost per service. The % increases in handling fees are applied to groups of services - not a fine enough control for my client - and we were trying to emulate the same rates as the previous module, so I found it much easier to make calculated increased per service hardcoded in the code.

 

2) Additionally, we had a customer with a SOAP error regarding the handling / use of special characters.

 

Fatal error: Uncaught SoapFault exception: [Client] SOAP-ERROR: Encoding: string 'M\xe9...' is not a valid utf-8 string in /includes/modules/shipping/fedexwebservices.php:268

 

I guess I will try to strip / convert special characters that are offensive in the module, class etc. Has anyone else slayed this one?

 

Thanks!

 

Jim

Share this post


Link to post
Share on other sites

OK, not sure if this will cause other issues, but in /includes/modules/shipping/fedexwebservices.php, I was able to stop the special character SOAP encoding error by applying utf8 encoding to the street address and city (that's where we were getting the errors). Tested ok.

 

In case it is useful, here's what I changed around line 160 in mine (which is slightly edited now):

 

 

$request['RequestedShipment']['Recipient'] = array('Address' => array (

'StreetLines' => array(utf8_encode($street_address), utf8_encode($street_address2)), // customer street address

'City' => (utf8_encode($city)), //customer city

Share this post


Link to post
Share on other sites

For those who got a '556' error: There are no valid services available. Just change the shipper State/Province data field (in admin panel) to a 2 character state format for e.g. "CA" instead of "California".

 

Great module!

Share this post


Link to post
Share on other sites

just throwing this out there, one of my clients has to use list rates for all of their us bound customers. unfortunatly as we all know this breaks international quotes. my fix was to show list rates to US customers and account rates to international with a surchage to make up the difference.

 

let me know if this is any help

 

find this line

 

	  if(MODULE_SHIPPING_FEDEX_WEB_SERVICES_RATES=='LIST')

 

and replace it with this

 

if ($order->delivery['country']['id'] != STORE_COUNTRY){
	    $cost = $rateReply->RatedShipmentDetails[0]->ShipmentRateDetail->TotalNetCharge->Amount;
	    $cost = (float)round(preg_replace('/[^0-9.]/', '',  $cost), 2);

	  }elseif(MODULE_SHIPPING_FEDEX_WEB_SERVICES_RATES=='LIST')

Share this post


Link to post
Share on other sites

I'm getting the following response (var_dump'ed) when tryng to issue getRates (line 271 of fedexwebservices.php):

 

array(3) {
 ["faultcode"]=>
 string(14) "soapenv:Server"
 ["faultstring"]=>
 string(46) "Internal system error. Please try again later."
 ["detail"]=>
 array(1) {
["fault"]=>
array(2) {
  ["errorCode"]=>
  string(1) "2"
  ["reason"]=>
  string(46) "Internal system error. Please try again later."
}
 }
}

 

Tested on the following systems:

OsCommerce 2.2rc2a (php5, soap, win and centos4)

CRE Loaded 6.15 (php4, nuSoap, centos4)

I've tried both test and production credentials on all systems. I've checked the request xml. All credentials are being passed correctly. Please help...

Edited by TpEnEpETE

Share this post


Link to post
Share on other sites

Run the SOAP test yet?

 

- Ive seen that error when their test server was down for maintanance, but never on production side

Share this post


Link to post
Share on other sites

I contacted the FedEx support staff. They said they got only one request from us and we already sent like 20. What is the POST field name for the request XML data? I'll try and send a couple of plain POST requests via an HTTP program to see if the requests make it through to their server. Also in the WSDL file I got the last couple of lines saying:

<service name="RateService">

<port name="RateServicePort" binding="ns:RateServiceSoapBinding">

<s1:address location="https://gateway.fedex.com/web-services/"/>

</port>

</service>

Is that the URL all the POST requests go to? Cause the fedex support guy sent us a slightly different one:

https://gateway.fedex.com:443/web-services (has the port number)

I ran the soap test on our php5 servers and it was positive (soap ext enabled). On the php4 server with nusoap the soap test is irrelevant but I've made changes to the module code to accomodate the nusoap specifics.

Thanks.

Share this post


Link to post
Share on other sites

I ran into a bit of a problem when I first installed this, but it's working now. I think I may know what that problem was, and I'm putting it up here in case anyone else is having touble getting this contribution to work.

 

First, I installed the contribution, and had FedEx tech support on the line as I filled out their forms and got the module installed. (By the way, if you are installing this for your own website, you select "Corporate Developer". Not particularly intuitive there...)

 

Attempts to get a rate quote sent the FedEx Web Services Key, Password, Account Number, and Meter Number. However, according to the technician, there were no rate requests. He told me that even if there was an error in the request, any request at all would have shown up.

 

As far as I could tell, the only thing the install instructions said to do that I hadn't done, was to remove the old FedEx module. I had set it to 'false', but not actually removed it from the database.

 

After I removed the old FedEx Shipping module, the FedEx Quotes started working.

Share this post


Link to post
Share on other sites

you also might want to scrub your entire site for any references containing "fedex1" and convert the relevent lines to webservices equivelents.

I was getting errors when removing the old module until I did that.

Skittles likes this

Share this post


Link to post
Share on other sites

Hi all, I installed this for a client who also has the order editor plugin. It failed in one spot, line 129. It was assuming there would be a cart and an order object, but in this case, there is no cart. This is the simple fix:

 

Change line 129 of catalog/includes/modules/shipping/fedexwebservices.php from:

 

$totals = $order->info['subtotal'] = $_SESSION['cart']->show_total();

 

to

 

$totals = $order->info['subtotal'] || $_SESSION['cart']->show_total();

 

HTH,

-Bill

Share this post


Link to post
Share on other sites

Hi all, I installed this for a client who also has the order editor plugin. It failed in one spot, line 129. It was assuming there would be a cart and an order object, but in this case, there is no cart. This is the simple fix:

 

Change line 129 of catalog/includes/modules/shipping/fedexwebservices.php from:

 

$totals = $order->info['subtotal'] = $_SESSION['cart']->show_total();

 

to

 

$totals = $order->info['subtotal'] || $_SESSION['cart']->show_total();

 

HTH,

-Bill

 

Thank you for that. And perfect timing for me.

 

I hadn't tried to use Order Editor since getting this installed. But I use OE whenever I ship an order. (I've rearranged things on the page, a bit, so I can just tab through the fields and copy the information in the order I need it to create a shipment online.) I'd have been very unhappy to lose OE's function.

 

After applying the fix, I tested the checkout_shipping page, and everything there worked just as it did before the fix. I figured you had tested that, but I hate to assume things... :)

 

I'm sure there are a lot of others who will be just as happy to find your fix.

 

Kudos. And thanks again.

Share this post


Link to post
Share on other sites

For the OE to work i atucally edited this line

 

$totals = $order->info['subtotal'] || $_SESSION['cart']->show_total();

 

to this and it also works

 

$totals = $cart->show_total();

Share this post


Link to post
Share on other sites

For everyone's info, FedEx has officially ended API support today.

 

If you have SOAP problem or any issues with web services and you are in USA, you still have one option: using the local zone rates contribution: http://addons.oscommerce.com/info/490

Share this post


Link to post
Share on other sites

Well... I guess we all new this day was coming... I'm back up and running with webservices! Thank you for all your hard work.

 

However, what I did not expect was Fedex Automatic Labels is ALSO now down;

 

This transaction could not be completed. Please note the error message below.

 

ERROR: FedEx Return Error 0531 : FedEx Ship Manager API has been retired. Please use an alternate FedEx solution, or go to http://www.fedex.com/us/developer/migration.html for more information.

 

Has anyone made any progress with Fedex Automatic Labels??????????

Share this post


Link to post
Share on other sites

Well... I guess we all new this day was coming... I'm back up and running with webservices! Thank you for all your hard work.

 

However, what I did not expect was Fedex Automatic Labels is ALSO now down;

 

This transaction could not be completed. Please note the error message below.

 

ERROR: FedEx Return Error 0531 : FedEx Ship Manager API has been retired. Please use an alternate FedEx solution, or go to http://www.fedex.com/us/developer/migration.html for more information.

 

Has anyone made any progress with Fedex Automatic Labels??????????

 

Someone will need to step up to update (pretty much re-write) that contribution for compatability with webservices. The WSDL format is very different from the real time quotes api...

Share this post


Link to post
Share on other sites
Someone will need to step up to update (pretty much re-write) that contribution for compatability with webservices. The WSDL format is very different from the real time quotes api...

 

Ouch... I have been looking at it... at it is WAY beyond my skills.

 

All I've figured out is, in the 2 fedexdc.php file, changing the servers from http://gateway.fedex.com:443/gatewayDC to;

 

if ($server == 'test') {
define('FEDEX_URI', 'https://ws.fedex.com:443/web-services', true);
define('FEDEX_HOST', 'ws.fedex.com', true);
}
elseif ($server == 'production') {
define('FEDEX_URI', 'https://ws.fedex.com:443/web-services', true);
define('FEDEX_HOST', 'ws.fedex.com', true);

 

And all the FEDEX1 in ship_fedex.php to FEDEXWEBSERIVCES

 

Obviously my look at this is VERY simplistic.... these files need to be changed to include the following;

 

$this->fedex_key

$this->fedex_pwd

$this->fedex_act_num

$this->fedex_meter_num

 

And then match them to the fedex-vars

 

10=>'MODULE_SHIPPING_FEDEXWEBSERIVCES_ACCOUNT', // 0 ??????????????????????????????

498=>'MODULE_SHIPPING_FEDEXWEBSERIVCES_METER', // 1????????????????????????????????

???? Need Number for fedex_key

???? Need number for fedex_pwd

 

Anyone out there (with actual skills... unlike "me"... LOL) working on this?????

Share this post


Link to post
Share on other sites

Ok Roaddoctor, I downloaded the ShipService WSDL guide and code and I see what you mean... This is so far beyond me...

 

If someone is working on this and needs help testing please let me know. Beyond that I'm afraid I useless...

Share this post


Link to post
Share on other sites

I have upgraded to FedExWebServices using this addon.

 

I am also using the Shipping Labels... The addon that uses ship_fedex.php and fedexdc.php.

 

I don't know how much longer fedexdc.php will be supported by FedEx, but it seems to work right now.

 

To get the Shipping Labels to work again, I did the following:

  • Change MODULE_SHIPPING_FEDEX1_ mentions to their MODULE_SHIPPING_FEDEX_WEB_SERVICES_ equivalent in both ship_fedex.php and purchase_ship_fedex.php
  • After doing that, I was getting "ERROR: FedEx Return Error F01F : Weight type not pounds (LBS) nor kilograms (KGS)" @ ship_fedex.php
  • Since the WebServices (for shipping quotes in the cart) requires weight to be LB or KG, I made the following edit for ship_fedex.php:

foreach($fedex_vars as $var) {
 $value_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = '" . $var . "'");
 $value = tep_db_fetch_array($value_query);
 // append an 'S' to the weight unit @phpJoel
 if($var == 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_WEIGHT') $value['configuration_value'] = $value['configuration_value'] . 'S';
 $value = $value['configuration_value'];

 

The labels are now being displayed again.

This hasn't been thoroughly tested or anything, but my goal was to get the labels working again for the time being.

Share this post


Link to post
Share on other sites

I also had to do this in purchase_ship_fedex.php

 

 

Within:

foreach($fedex_vars as $var) {

add the "S"-addition code..


		  $value_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = '" . $var . "'");
		  $value = tep_db_fetch_array($value_query);
		  // append an 'S' to the weight unit @phpJoel
		  if($var == 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_WEIGHT') $value['configuration_value'] = $value['configuration_value'] . 'S';
		  $value = $value['configuration_value'];

Share this post


Link to post
Share on other sites

Many thanks for this contribution! After installing Fedex Web Services 9 on our site (osc 2.2), it seemed to be working fine. But just to be sure I compared the rates which were being quoted on our store with the rates we get simply by logging into the FedEx website. The rates for "FedEx 2 Day" and "FedEx Express Saver" match to the penny. But the rates for "Standard Overnight" and "Priority Overnight" are way off. Just to experiment, I zero'd out all our handling fees, and tried it both with displaying "list" and "account" rates. The numbers do change, but they're still wrong.

 

Here's an example. We currently have the FedEx shipping module set to display ACCOUNT rates, and add a $5 handling charge. Let's use a hypothetical .8 pound package going from Dallas 75227 to Chicago 60601. Our OSC store quotes the following:

Priority Overnight - $46.90

Standard Overnight - $42.66

 

But logging into fedex.com and getting a rate quote for the same package with our same account number, we get:

Priority Overnight - $25.41

Standard Overnight - $23.66

 

Even adding the $5 handling fee to the FedEx quote, you can see that the rates shown on our store are > $15 higher. And yet the rates for FedEx 2 Day and FedEx Express Saver agree perfectly. (These are the 4 services we are offering, so I did not compare any of the other possible rates.)

 

How can this be happening? And, more importantly, can anyone suggest a fix? I would encourage everyone to try a similar test to make certain that the prices you are displaying have some basis in reality. Thanks.

Share this post


Link to post
Share on other sites

Many thanks JOELphp, I don't have a file called purchase_ship_fedex.php... This doesn't seem to be part of the orginal mod.

 

Change MODULE_SHIPPING_FEDEX1_ mentions to their MODULE_SHIPPING_FEDEX_WEB_SERVICES_ equivalent in both ship_fedex.php and purchase_ship_fedex.php

 

Any thoughts?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now