Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Automated FedEx Labels


spoot

Recommended Posts

How exactly does one get on the testing server for FedEx?

 

We call FedEx and they continuously tell us to send in a transaction code with the initial api conect.  They also have refered us to thick volumes of manuals that make no sense whatsoever.

 

Please clearly outline what one msut do to get on a test server.

 

Jason

www.orangetkomidwest.com

[email protected]

 

Have you installed FedEx Realtime Quotes? The first transaction you make with that contribution (or this one, if I recall correctly) should ask FedEx for a meter ID; that meter ID will be returned to oscommerce & added to the Realtime Quotes configuration information. Once you've got a meter ID, you should be set.

 

It's a little whacky, but it works. Let me know if this makes any sense.

 

Michael

Link to comment
Share on other sites

  • Replies 713
  • Created
  • Last Reply

Top Posters In This Topic

Another note - it's during the installation of FedEx Realtime Quotes that you'll be contacting FedEx to get added to their test server.

 

Here's what you do (I'll add this to the docs shortly):

 

- Call 800-810-9073

- When you hit a voice prompt (the thing that says "tell me what you want" or whatever), say:

 

"I need wep A.P.I."

 

That will get you to the people you need.

Link to comment
Share on other sites

I'm still getting the following error:

ERROR: FedEx Return Error 1219 : Invalid package count or package sequence exceeds package count.

 

 

Could you try changing line 270 in admin/ship_fedex.php from:

 

$shipData[1123] = 'master_trackNum';

to:

$shipData[1123] = $master_trackNum;

 

...and post your debugging information again?

 

Thanks -

 

Michael

Link to comment
Share on other sites

  • 2 weeks later...

Michael...

 

Great Mod... got it working like a champ, after much head banging with FEDEX, but it is all good now.

 

My question is that when I ship, it adds a comment to the order showing the Tracking number, but it doesn't notify customer of this addition. What would I need to do to have it automatically notify customer via email that the shipment is on its way?

 

Thanks in advance...

 

Oh, and have a great holiday.

 

Greg

Link to comment
Share on other sites

Michael...

 

Great Mod... got it working like a champ, after much head banging with FEDEX, but it is all good now.

 

My question is that when I ship, it adds a comment to the order showing the Tracking number, but it doesn't notify customer of this addition.  What would I need to do to have it automatically notify customer via email that the shipment is on its way?

 

Thanks in advance...

 

Oh, and have a great holiday.

 

Greg

 

Greg -

 

I'm glad you like it, & I'm glad you got it running. The installation can be a real pain, I know.

 

So have the customer automatically get sent an email w/tracking number? This is another thing that should be user configurable. I'm working on a rebuild of sorts, & will hopefully add administrative features, we'll see. If I do, I'll try to add this.

 

Michael

Link to comment
Share on other sites

I installed this package just recently. I did a purchase by "a customer". When I selected the "Customers / Orders / ship /" from the administration tool, I filled in all package details

 

Number of Packages: 1

Oversized?

Packaging Type ("other" for ground shipments): Other Packaging

Type of Service: Fedex 2Day

Payment Type: Bill Sender (Prepaid)

Dropoff Type: Regular Pickup

Pickup date (yyyymmdd): 12-30-2004

 

The Package Weight: 2

 

I received the next response:

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

ERROR: FedEx Return Error 1F33 : Sender phone for US/Canada must be 10 digits."

 

What is the problem? What should I do?

Where could I set this phone number?

 

Gabor

Link to comment
Share on other sites

The cancel button doesn't fully cancel shipments. I just got my credit card statement, and found I was billed a residential surcharge even though the package itself was cancelled. I'm also now being billed a weekly pickup fee, from when I scheduled a single pickup but later cancelled it.

 

Is there some additional information we can add to the cancellation XML to avoid the fedex billing trap?

Link to comment
Share on other sites

The previous post was my fault, I've just reentered the phone number in

Admin / Modules / Shipping / Federal Express / Edit / Phone number,

it has to be 10 digits and then it works fine.

 

Netx issue:

I had some problem with province/state, It was the "Alberta" instead of "AB".

This was probably caused by my changes, but I fixed it.

After that I sent the next XML querry, but I havn't received any response.

 

The only thing I got was the next message on the browser:

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

ERROR: cURL ERROR: 28: Operation timed out with 0 out of -1 bytes received

unable to process ship_express"

 

I checked the sent querry from my log file::

 

FEDEX LABEL URL: https://gateway.fedex.com/GatewayDC

FEDEX REQUEST: 0,"21"16,"AB"13,"64 Cumb"1273,"01"1274,"03"18,"5165656556"15,"Calgary"23,"01"117,"CA"17,"t2k1t1"50,"CA"11,""12,"Gabor Gorcsos"1333,"1"1415,"5.00"1368,"2"1369,"1"1370,"5"24,"20041230"1119,"Y"2975,"Y"440,"N"10,"1xxxxxxx6"498,"8xxxxx5"75,"KGS"4,"PremierShop"5,"xxxx Pxxxxx Way NE"6,"NONE"7,"Calgary"8,"AB"9,"T2E8M5"183,"4xxxxxxxx9"68,"USD"1401,"2.0"3025,"FDXE"99,""

FEDEX RESPONSE:

 

Any ideas?

 

 

Gabor

Link to comment
Share on other sites

The cancel button doesn't fully cancel shipments. I just got my credit card statement, and found I was billed a residential surcharge even though the package itself was cancelled. I'm also now being billed a weekly pickup fee, from when I scheduled a single pickup but later cancelled it.

 

Is there some additional information we can add to the cancellation XML to avoid the fedex billing trap?

 

Ok, I've spoken with Fedex, and basically the Cancel feature does not appear to cancel anything. If someone can provide me with the following, I (or anyone that wants) can work with fedex to identify what's missing:

 

* sample of what the module sends to FedEx when requesting a label

* sample of FedEx's response

* sample of what the module sends to FedEx when attempting to cancel a shipment

* sample of FedEx's response

Link to comment
Share on other sites

I've jjust contacted the Fedex. They told me I should not insert 68,"USD" what is the US currency for shipping within Canada. I've just removed it but it doesn't seem to work either.

Any ideas?

Gabor

 

FEDEX LABEL URL: https://gateway.fedex.com/GatewayDC

FEDEX REQUEST: 0,"21" 16,"AB" 13,"64 Cumb" 1273,"01" 1274,"03" 18,"5165656556" 15,"Calgary" 23,"01" 117,"CA" 17,"t2k1t1" 50,"CA" 11,"" 12,"Gabor Gorcsos" 1333,"1" 1415,"5.00" 1368,"2" 1369,"1"1370,"5" 24,"20041230" 1119,"Y" 2975,"Y" 440,"N" 10,"1xxxxxxx6" 498,"8xxxxx5"75," KGS"4," PremierShop"5," 2xx8 Pxxxxx Way NE" 6,"NONE" 7,"Calgary" 8,"AB" 9,"T2E8M5" 183,"4xxxxxxxx9" 1401,"2.0" 3025,"FDXE"99,""

FEDEX RESPONSE:

 

 

P.s.: I added some spaces to this request only for this forum.

Link to comment
Share on other sites

FEDEX LABEL URL: https://gateway.fedex.com/GatewayDC

FEDEX REQUEST: 0,"21"16,"Alberta"13,"64 Cumb"1273, "01"1274,"03"18,"5165656556"15, "Calgary"23,"01"117,"CA"17,"t2k1t1"50,"CA"11,""12,"Gabor Gorcsos"1333,"1"1415,"5.00"1368, "2"1369,"1"1370,"5"24,"20041230"1119,"Y"2975,"Y"440,"N"10,"1xxxxxxxxx6"498,"8xxxxxxx5"75,

"KGS"4,"PremierShop"5,"2xx8 Pxxxxxxx Way NE"6,"NONE"7,"Calgary"8,"AB"9, "T2E8M5"183,"4xxxxxxxxx9"68,"USD"1401,"2.0"3025,"FDXE"99,""

 

 

FEDEX RESPONSE: HTTP/1.1 200 OK

Server: Netscape-Enterprise/4.1

Date: Wed, 29 Dec 2004 20:38:37 GMT

Content-length: 78

Content-Type: image/gif

 

0,"121"2,"8027"3,"State or province abbreviation must be two characters."99,""

Link to comment
Share on other sites

I forgot...

 

Im getting the following error when cancelling a shipment:

 

ERRORFedEx Return Error 1F25 : Ship date must be 8 digits CCYYMMDD

 

 

Did this ever get answered? I'm getting the same error. I also see that when I enter new shipping info that the date format is incorrect. But even when I put it in the proper format to make a label, I still get that error if I try to cancel the shipment. Thanks!

Link to comment
Share on other sites

Ok, I've spoken with Fedex, and basically the Cancel feature does not appear to cancel anything. If someone can provide me with the following, I (or anyone that wants) can work with fedex to identify what's missing:

 

* sample of what the module sends to FedEx when requesting a label

* sample of FedEx's response

* sample of what the module sends to FedEx when attempting to cancel a shipment

* sample of FedEx's response

 

Can someone tell me how to turn logging on, so I can capture the above info, and get Cancel working for all of us? Thanks !

Link to comment
Share on other sites

Can someone tell me how to turn logging on, so I can capture the above info, and get Cancel working for all of us? Thanks !

 

Hi!

 

I'm using the next logging methode: (add into the admin/includes/fedexdc.php)

 

$this->logfile = '/tmp/fedex_label.log'; // Add at the end of the FedExDC function

 

// Add the next bellow after this: "curl_setopt( $ch, CURLOPT_POSTFIELDS, $this->sBuf );"

if ($this->logfile) {

error_log("FEDEX REQUEST: " . $this->sBuf . "\n", 3, $this->logfile);

}

 

 

//Add the next bellow after this: "$this->httpData = curl_exec($ch);"

if ($this->logfile) {

error_log("FEDEX RESPONSE: " . $this->httpData . "\n", 3, $this->logfile);

}

 

 

Do not forget to create a file in /tmp/fedex_label.log with chmod 777

Good luck!!!

 

Gabor the Hun

Edited by gorcsos
Link to comment
Share on other sites

I tried to make a shippment to US from Canada. Here is the request.

Any ideas about "Duties and taxes payment type required" ?

Gabor

 

 

FEDEX REQUEST: 0,"21"16,"NY"13,"125 St 67Ave"1273,"01"1274,"03"18,"6565651123"15,"NY" 23,"01"117,"CA"17,"10016"50,"US"11,""12,"Tom Newyork"1333,"1"1415,"4.00"1368,"2"1369,"1" 1370,"5"24,"20041231"1119,"Y"2975,"Y"440,"N"10,"1xxxxxxxx6"498,"8xxxxx5"75,"KGS" 4,"PremierShop"5,"2xx8 Pxxxxx Way NE"7,"Calgary"8,"AB"9,"T2E8M5"183,"4032958879 "68,"USD"1401,"2.0"3025,"FDXE"99,""

 

FEDEX RESPONSE: HTTP/1.1 200 OK

Server: Netscape-Enterprise/4.1

Date: Thu, 30 Dec 2004 17:08:07 GMT

Content-length: 63

Content-Type: image/gif

 

0,"121"2,"8083"3,"Duties and taxes payment type required."99,""

Link to comment
Share on other sites

Ok, Fedex has verified I'm on their test server. When I try to print a label I get the following error message:

 

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

below.

ERROR: FedEx Return Error 5012 : Account number not in database"

 

Fedex's response to this was "We confirmed your account is active on the test server. We were able to ship successfully on the test server with the meter XXXXXXX and account number XXXXXXXXX. We would suggested that you ensure you are using the above meter and account in your transaction and that you are sending the transaction to the test server at gatewaybeta.fedex.com on port 443."

 

How do I make sure I'm sending the transaction to the test server at gatewaybeta.fedex.com on port 443? Where do I check for that?

 

Thanks! Charlie

Link to comment
Share on other sites

On another note. Has anyone figured out a way to allow some items in their store to have No shipping charge (ie gift certificates, downloadable materials, etc), and other items shipping by FedEx? I put the weight as Zero for those items, but it still comes up with a Fedex shipping charge.

 

Thanks!

Link to comment
Share on other sites

Ok, Fedex has verified I'm on their test server.  When I try to print a label I get the following error message:

 

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

below.

ERROR: FedEx Return Error 5012 : Account number not in database"

 

Fedex's response to this was "We confirmed your account is active on the test server.  We were able to ship successfully on the test server with the meter XXXXXXX and account number XXXXXXXXX. We would suggested that you ensure you are using the above meter and account in your transaction and that you are sending the transaction to the test server at gatewaybeta.fedex.com on port 443."

 

How do I make sure I'm sending the transaction to the test server at gatewaybeta.fedex.com on port 443?  Where do I check for that?

 

Thanks!  Charlie

 

 

I had something similar. Your account and numbers could be good, the code has some "features" (bugs). There is still some problem with the fedexdc.php. I did some changes and it works for me now.

!!!These are only pieces of code!!!

!!!This is not the full working and tested new module!!!

Be inspitred by "fedex1.php" from the payment module.

 

In the function:

 

function _sendCurl() {

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://' . $this->server);

 

curl_setopt($ch, CURLOPT_HEADER, 1);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // Dec. 29 2004, by Gabor

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); // Dec. 29 2004, by Gabor

 

curl_setopt($ch, CURLOPT_HTTPHEADER, array("Referer: " . STORE_NAME,

"Host: " . $this->server,

"Accept: image/gif,image/jpeg,image/pjpeg,text/plain,text/html,*/*",

"Pragma:",

"Content-Type:image/gif"));

 

/********************************************************************************

*********/

 

if ($server == 'test') {

define('FEDEX_URI', 'gatewaybeta.fedex.com/GatewayDC', true);

define('FEDEX_HOST', 'gatewaybeta.fedex.com', true);

}

elseif ($server == 'production') {

define('FEDEX_URI', 'gateway.fedex.com/GatewayDC', true);

define('FEDEX_HOST', 'gateway.fedex.com', true);

}

 

 

$this->server = FEDEX_URI;

Link to comment
Share on other sites

Holy mackerel, shows what I get for not checking in now and then.

 

Did you ever get this fixed:  "ERROR: FedEx Return Error 5012 : Account number not in database"

 

I'm having the same problem.

 

Any help would be greatly appreciated.

 

Thanks!  Charlie

 

Make sure your meter ID is for the test database.

 

Make sure FedEx Realtime Quotes is set to use the test server.

 

Then delete your meter ID in the FedEx Realtime Quotes admin.

 

Then make a request for a FedEx quotes by initiating an order through your store (to the point where you get the list of FedEx prices).

 

Then try the ship request again.

 

 

When you get this error, first thing to do is regenerate your meter ID. (This burned me recently, lots of hassling of FedEx until I realized that the problem was, not surprisingly, on my side, with a faulty meter ID.)

 

Michael

Link to comment
Share on other sites

On another note.  Has anyone figured out a way to allow some items in their store to have No shipping charge (ie gift certificates, downloadable materials, etc), and other items shipping by FedEx?  I put the weight as Zero for those items, but it still comes up with a Fedex shipping charge.

 

Thanks!

 

Here you may want to try asking on the FedEx Realtime Quotes support thread. I believe there are ways to do what you want to do, but this module doesn't deal with the pricing.

Link to comment
Share on other sites

Can someone tell me how to turn logging on, so I can capture the above info, and get Cancel working for all of us? Thanks !

 

This is a new error - cancel used to work great. The cancel request doesn't include a date - and according to the API, it's neither possible nor necessary to include one.

 

To show debugging information for a cancel request, in ship_fedex.php replace:

 

$cancelData = $fedex_keys+$cancelData;

 

with

 

// debugging
	 if ($debug) {
   echo 'Cancel shipment request data, package #' . $i . ':<br/><pre>';
   print_r($cancelData);
   echo '</pre><br/>';
   die('running in debug mode, cancel request not made');
   }
	 else {
   $cancelData = $fedex_keys+$cancelData;
   }

 

(I haven't tested this yet, but it should do the job.)

 

The debug output doesn't give the information in exactly the format in which it goes to FedEx, but it does show what fields we're sending them, & what data. I haven't yet talked to them about this error, please let me know what you hear from them if you do.

 

Thanks

 

Michael

Link to comment
Share on other sites

FEDEX LABEL URL: https://gateway.fedex.com/GatewayDC

FEDEX REQUEST: 0,"21"16,"Alberta"13,"64 Cumb"1273, "01"1274,"03"18,"5165656556"15, "Calgary"23,"01"117,"CA"17,"t2k1t1"50,"CA"11,""12,"Gabor Gorcsos"1333,"1"1415,"5.00"1368, "2"1369,"1"1370,"5"24,"20041230"1119,"Y"2975,"Y"440,"N"10,"1xxxxxxxxx6"498,"8xxxxxxx5"75,

"KGS"4,"PremierShop"5,"2xx8 Pxxxxxxx Way NE"6,"NONE"7,"Calgary"8,"AB"9, "T2E8M5"183,"4xxxxxxxxx9"68,"USD"1401,"2.0"3025,"FDXE"99,""

FEDEX RESPONSE: HTTP/1.1 200 OK

Server: Netscape-Enterprise/4.1

Date: Wed, 29 Dec 2004 20:38:37 GMT

Content-length: 78

Content-Type: image/gif

 

0,"121"2,"8027"3,"State or province abbreviation must be two characters."99,""

 

 

Gabor -

 

Thanks for that logging information, it's cool. I'll mess with it & add it to the module.

 

Regarding shipments from/to Canada: someone named justken has posted a fairly extensive fix for this, starting around page 4 of this thread. More stuff I want to add to the module; but in the meantime, look over his posts & new code & see if it can help solve your problem.

 

Let us know how it goes -

 

Michael

Link to comment
Share on other sites

The cancel button doesn't fully cancel shipments. I just got my credit card statement, and found I was billed a residential surcharge even though the package itself was cancelled. I'm also now being billed a weekly pickup fee, from when I scheduled a single pickup but later cancelled it.

 

Is there some additional information we can add to the cancellation XML to avoid the fedex billing trap?

 

This is nasty. Please let me know what you hear from FedEx, & I'll try to hassle them as well. As far as I know, the cancel request is sending them everything they need; maybe that's not the case though.

Link to comment
Share on other sites

I had something similar. Your account and numbers could be good, the code has some "features" (bugs). There is still some problem with the fedexdc.php. I did some changes and it works for me now.

!!!These are only pieces of code!!!

!!!This is not the full working and tested new module!!! 

Be inspitred by "fedex1.php" from the payment module.

 

In the function:

 

        function _sendCurl() {

                $ch = curl_init();

                curl_setopt($ch, CURLOPT_URL, 'https://' . $this->server);

 

              curl_setopt($ch, CURLOPT_HEADER, 1);

              curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

              curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);

              curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // Dec. 29 2004, by Gabor

              curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); // Dec. 29 2004, by Gabor

 

        curl_setopt($ch, CURLOPT_HTTPHEADER, array("Referer: " . STORE_NAME,

                                                  "Host: " . $this->server,

                                                  "Accept: image/gif,image/jpeg,image/pjpeg,text/plain,text/html,*/*",

                                                  "Pragma:",

                                                  "Content-Type:image/gif"));

 

/********************************************************************************

*********/

 

if ($server == 'test') {

define('FEDEX_URI', 'gatewaybeta.fedex.com/GatewayDC', true);

define('FEDEX_HOST', 'gatewaybeta.fedex.com', true);

}

elseif ($server == 'production') {

define('FEDEX_URI', 'gateway.fedex.com/GatewayDC', true);

define('FEDEX_HOST', 'gateway.fedex.com', true);

}

$this->server = FEDEX_URI;

 

So I put this in the fedex1.php code? where do I put it in there? Just add it at the end, or is there something I need to replace?

Link to comment
Share on other sites

Holy mackerel, shows what I get for not checking in now and then.

 

Did you ever get this fixed:? "ERROR: FedEx Return Error 5012 : Account number not in database"

 

I'm having the same problem.

 

Any help would be greatly appreciated.

 

Thanks!? Charlie

 

Make sure your meter ID is for the test database.

 

Make sure FedEx Realtime Quotes is set to use the test server.

 

Then delete your meter ID in the FedEx Realtime Quotes admin.

 

Then make a request for a FedEx quotes by initiating an order through your store (to the point where you get the list of FedEx prices).

 

Then try the ship request again.

When you get this error, first thing to do is regenerate your meter ID. (This burned me recently, lots of hassling of FedEx until I realized that the problem was, not surprisingly, on my side, with a faulty meter ID.)

 

Michael

 

I tried all of that again and I get the exact same error.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...