Jump to content

Archived

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

Christopher Short

Shipping error with Fedex

Recommended Posts

No, the gateways know where to send the request. It's embedded in the code.
 
From what I see in the code, the URL may be:

http*//fedex.com/ws/rate/v13/
http*//fedex.com/ws/rate/v13/getRates (probably not)
https*//ws.fedex.com:443/web-services/ship (probably not)

Share this post


Link to post
Share on other sites

Well, for those who want to try this, let's add a statement that will dump the actual request to the error log.

 

In /modules/shipping/Fedex/shipping.class.php, near line 168, there is:

$response = $this->_client->getRates($request);

On a new line after that, add:

trigger_error( "FEDEX REQUEST:" . $this->_client->__getLastRequest() );

 

If these errors are showing up in CubeCart's admin Error Log, System Error Log, we can check if what needs sent is getting sent.

Share this post


Link to post
Share on other sites

To answer your question Brian the getRates function will return an object that can be used to check values. We've had a few support tickets about this but so far its come down to module configuration. If a sales ticket can be opened with FTP and admin access I can debug this thoroughly. It's hard to help without getting my hands dirty. 

 

In the shipping.class.php file of the module after:

$response = $this->_client->getRates($request);

Add:

var_dump($response);

This will output the return data on screen during checkout.

 

I have a test account which seems to also fail on authentication. I don't know if the integration has changed as it certainly used to work...

 

Developer Test Key:

 M9ufQOdtCn9ll71X

Test Account Number:

 510087062

Test Password:

FooU8Gewy6IRFknQna0fhdMW6

Test Meter Number:

 118588781

Share this post


Link to post
Share on other sites

I'll put this here temporarily and then delete it, as it's HUGE!

(screen dump removed) 

This Debug Warning also:

 

[Warning] /home3/butter01/public_html/plushcatalog/includes/functions.inc.php:597 - Cannot modify header information - headers already sent by (output started at /home3/butter01/public_html/plushcatalog/modules/shipping/FedEx/shipping.class.php:169)

 

And the Checkout page did NOT show at all.

 

Took the dump code off and refreshed the page, and all looked OK. Warning about header went away, too. I carried the order as far as adding a Delivery Address, and the Fedex choices disappeared, with this error message:

 

[Notice] /home3/butter01/public_html/plushcatalog/modules/shipping/FedEx/shipping.class.php:197 - FedEx Error: The length of the destination state or province exceeds the limit of 2 characters.

States ARE shown as numbers in the _addressbook table for both billing and delivery for this newly created test account. This is a LIVE production Fedex account.

I'll be gone for a while today, so I've disabled Fedex shipping for now on our plushcatalog site. Hopefully that helped.

Share this post


Link to post
Share on other sites

Well yours is working. Just remove the line

var_dump($response);

.. and you should see shipping options in your basket.

Share this post


Link to post
Share on other sites

"I have a test account which seems to also fail on authentication."

 

Having Googled for similar problems, I noticed a number of events dealt with the fact that test credentials are required to use a different URL to make test rate requests.

 

Other URLs I've seen are:

https*//gateway.fedex.com:443/web-services (production)

https*//gatewaybeta.fedex.com:443/web-services (testing)

 

According to what was reported, when you sign up for a Fedex account, you will get an email that includes the URL to use -- presumably with instructions on what to change in the code.

 

First is to test, then login to your Fedex account to "self-certify" yourself that you can accurately make rate requests and to be switched to production, and another email is sent with production credentials and URL.

 

Another report: "FedEx periodically purges the test servers. Requesting updated credentials will resolve your issue."

Share this post


Link to post
Share on other sites

I found my error-my password was different for it. However, fedex shows the requests coming through with the states spelled out and they require it to be a 2 digits code(Florida=Fl ect). How do I fix that?

Share this post


Link to post
Share on other sites

Hi Chris, you shouldn't nee to worry about that. Are you getting an error or behaviour you don't expect?

Share this post


Link to post
Share on other sites

Hi Chris, you shouldn't nee to worry about that. Are you getting an error or behaviour you don't expect?

This is the error code. [25-Oct-2013 15:08:55] PHP Notice: FedEx Error: The length of the destination state or province exceeds the limit of 2 characters.

Share this post


Link to post
Share on other sites

Thats just a notice so might be something we can ignore. Most importantly are you getting FedEx shipping results in the drop down menu?

Share this post


Link to post
Share on other sites

Hmm that worked too. Does the item in question have a weight assigned? I tried 'D12X173' which worked. What is the item code of the one which doesn't work?

Share this post


Link to post
Share on other sites

The two-letter state does matter.

 

The "estimated value" (what you get when there is no customer destination address*) is based on the state for the store's location, which very likely does contain a number in the config data -- which allows the getStateFormat() function to return the desired data.

 

Due to a bug in the code (in CC522 - maybe still in CC524), some addresses may have the state's name recorded in the addressbook instead of the state_id. This prevents the proper retrieval of the state_iso via getStateFormat().

 

Christopher, your CC_addressbook table might have a name for the 'state' field for the account you are testing with.

 

Can you verify that?

 

* CubeCart uses the store's location as the destination address when making the initial rate quotes. That means the estimated prices listed are for a shipment from you - to you.

Share this post


Link to post
Share on other sites

Mine works UNTIL I log in. Then only the USPS choices show. Debug still showing that same Fedex number of characters notice.

Share this post


Link to post
Share on other sites

The two-letter state does matter.

 

The "estimated value" (what you get when there is no customer destination address*) is based on the state for the store's location, which very likely does contain a number in the config data -- which allows the getStateFormat() function to return the desired data.

 

Due to a bug in the code, some addresses may get the state's name recorded in the addressbook instead of the state_id. This prevents the proper retrieval of the state_iso via getStateFormat().

 

Christopher, your CC_addressbook table might have a name for the 'state' field for the account you are testing with.

 

Can you verify that?

 

* CubeCart uses the store's location as the destination address when making the initial rate quotes. That means the estimated prices listed are for a shipment from you - to you.

It does, has state spelled out fully. I don't see a way to fix it as it is a dropdown tab with selections built in,

Share this post


Link to post
Share on other sites

I have developed a code-snippet that should allow an admin to fix the addressbook. If your addressbook has hundreds of records with names (as opposed to numbers) in the state field, then this snippet would be of benefit.

 

But if you have just a dozen or so records with names, take note of the state names. Then, in the CC_geo_zone table, note the 'id' of those states.

 

Back in the CC_addressbook table, replace the names with the respective 'id'.

 

Test.

Share this post


Link to post
Share on other sites

I have developed a code-snippet that should allow an admin to fix the addressbook. If your addressbook has hundreds of records with names (as opposed to numbers) in the state field, then this snippet would be of benefit.

 

But if you have just a dozen or so records with names, take note of the state names. Then, in the CC_geo_zone table, note the 'id' of those states.

 

Back in the CC_addressbook table, replace the names with the respective 'id'.

 

Test.

I have 78 customers.

Share this post


Link to post
Share on other sites

×
×
  • Create New...