Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * * 1 votes

Canada Post Automated Labels 2.0 AND Canada Post Shipping Module 4.0


229 replies to this topic

#61 insaini

  • Community Member
  • 205 posts
  • Real Name:Jesse B.
  • Gender:Male
  • Location:Brampton, Ontario

Posted 02 June 2008, 10:53

View Postnewbie1233, on Jun 1 2008, 10:03 PM, said:

Ok, I figured out the cookie problem but I still get these errors:


Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/esteemforthehome.ca/httpdocs/catalog/admin/includes/functions/ship_canadapost.php on line 13
Step 1. Initialized.

Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/esteemforthehome.ca/httpdocs/catalog/admin/includes/functions/ship_canadapost.php on line 13
Step 2. Logged In.

Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/esteemforthehome.ca/httpdocs/catalog/admin/includes/functions/ship_canadapost.php on line 13
Step 3. Started shipping application.

Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/esteemforthehome.ca/httpdocs/catalog/admin/includes/functions/ship_canadapost.php on line 13
Step 4. Error: Failed check in /home/esteemforthehome.ca/httpdocs/catalog/admin/includes/languages/english/ship_canadapost.php at line 9. This most likely means that Canada Post has changed their user interface. You need to update your Canada Post Automatic Shipping Labels module.

So that I don't look like I'm talking to myself on this forum any response would be appreciated.

Thank you


Sorry guys been a little busy.. ill be on later tonight to answer some messages.. but quickely..

Yes curl MUST! be built with OpenSSL AND! libssh2 .. otherwise you will not pass step 2 for authentication on canadapost servers.

newbie.. seems your curl is running in safe mode.. dont know why but maybe its a host issue..

J

#62 insaini

  • Community Member
  • 205 posts
  • Real Name:Jesse B.
  • Gender:Male
  • Location:Brampton, Ontario

Posted 04 June 2008, 00:31

View Postroback, on May 26 2008, 05:38 PM, said:

Hey I tried reverting shopping_cart.php back to the original file and it again displays the correct price. Now I also proceeded through the checkout and it appeared to work just the same with the default shopping_cart.php.

Now a WinDiff on the two version shows the only significant difference is that
[code]p.products_weight, p.products_length, p.products_width, p.products_height, p.products_ready_to_ship[\code]
are added to two of the queries (approx lines 259 and 319) and
[code]
'length' => $products['products_length'],
'width' => $products['products_width'],
'height' => $products['products_height'],
'ready_to_ship' => $products['products_ready_to_ship'],
[\code]
added to the product array (approx line 336).

I am not great at picking apart the code to determine where things go and how they function so can you explain the need for these in the shopping_cart.php

thanks

appreciated.


You definitely need this code as it deals with the product dimensions.. they are needed in the queries... however.. these added fields to the queries would in no way affect the pricing..

#63 insaini

  • Community Member
  • 205 posts
  • Real Name:Jesse B.
  • Gender:Male
  • Location:Brampton, Ontario

Posted 04 June 2008, 00:34

View Postcwm3, on May 30 2008, 03:31 AM, said:

Quick 2 questions.

I noticed that the Expedited and Regular shipping prices are the same. Priority is of course more expensive. But why the 2 same prices? Can this be different?

Also, seems like everything is installed correctly, just wondering why my process is stopped at step 2. Logging into CP's system? What should I double check here?


THese are the prices that are being returned by Canada Post.. sometimes they are the same.. but for the customer.. to them its a no brainer to choose Expedited.. you can if you like.. disable Regular shipping prices by logging into your sellonline account and removing that option..

Number 2.. you most definitely need to have your curl built with openssl AND! libssh2 .. this is an absolute must otherwise you will not pass step 2.. step 2 is used for SSL authentication on Canada Post servers...

#64 Panda_X

  • Community Member
  • 2 posts
  • Real Name:Steve Looi

Posted 04 June 2008, 15:17

View Postinsaini, on Jun 4 2008, 01:34 AM, said:

Number 2.. you most definitely need to have your curl built with openssl AND! libssh2 .. this is an absolute must otherwise you will not pass step 2.. step 2 is used for SSL authentication on Canada Post servers...


Hi Guys,

I'm in the same boat as Ivan and others with cURL. Everything is good except when i go to print labels, I can't get passed step 2.
I have checked and my cURL installation is libcurl/7.13.2 OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13 so im guessing im missing the libssh2. Now how do I fix that? I have been looking all over the net and I can't find any tutorials or how-tos. I've asked my host they said you cant simply add libssh2 and that they can't solve these kinds of problems for me. Can anyone help with this or point me in the right direction? Do I need to rebuild cURL?

THANKS!! :)

#65 insaini

  • Community Member
  • 205 posts
  • Real Name:Jesse B.
  • Gender:Male
  • Location:Brampton, Ontario

Posted 05 June 2008, 00:34

View PostPanda_X, on Jun 4 2008, 11:17 AM, said:

Hi Guys,

I'm in the same boat as Ivan and others with cURL. Everything is good except when i go to print labels, I can't get passed step 2.
I have checked and my cURL installation is libcurl/7.13.2 OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13 so im guessing im missing the libssh2. Now how do I fix that? I have been looking all over the net and I can't find any tutorials or how-tos. I've asked my host they said you cant simply add libssh2 and that they can't solve these kinds of problems for me. Can anyone help with this or point me in the right direction? Do I need to rebuild cURL?

THANKS!! :)

There is no adding libssh2 .. curl has to be recompiled with libssh2 .. only your host can do that for you.. if they are unwilling.. I would suggest finding another host..

unfortunately .. for SSL authentication.. libssh2 is mandatory.. no way around it apparently..


Jesse

#66 Panda_X

  • Community Member
  • 2 posts
  • Real Name:Steve Looi

Posted 05 June 2008, 14:20

Thanks Jesse!

Talking to my host now.. crossing my fingers.

#67 roback

  • Community Member
  • 69 posts
  • Real Name:Rob

Posted 05 June 2008, 18:03

View Postinsaini, on Jun 4 2008, 06:34 PM, said:

There is no adding libssh2 .. curl has to be recompiled with libssh2 .. only your host can do that for you.. if they are unwilling.. I would suggest finding another host..

unfortunately .. for SSL authentication.. libssh2 is mandatory.. no way around it apparently..


Jesse


So is there any other way around this libssh2? My host will only provide that if upgraded to SSL hosting plan.

Thought there was someone who mentioned cURL redirect or something for one file on a secure server? Any enlightement on this approach?

#68 insaini

  • Community Member
  • 205 posts
  • Real Name:Jesse B.
  • Gender:Male
  • Location:Brampton, Ontario

Posted 05 June 2008, 23:20

View Postroback, on Jun 5 2008, 02:03 PM, said:

So is there any other way around this libssh2? My host will only provide that if upgraded to SSL hosting plan.

Thought there was someone who mentioned cURL redirect or something for one file on a secure server? Any enlightement on this approach?

THe redirect will require a rewrite of the code somewhat to be secure..

if you use a redirect to someone else's server where curl has libssh2 built.. then your redirect will be unsecured.. you will be transmitting your login / pass over http to the redirecting server before it is transmitted over https to canadapost.. if someone intercepts that transmission.. they will have the username and password for your canadapost account.. gaining access to your credit card information..

another question is.. why dont you have an SSL hosting plan? are you running oscommerce without ssl?

#69 roback

  • Community Member
  • 69 posts
  • Real Name:Rob

Posted 06 June 2008, 00:32

View Postinsaini, on Jun 5 2008, 05:20 PM, said:

another question is.. why dont you have an SSL hosting plan? are you running oscommerce without ssl?

Running payments through PayPal Standard so no secure info is passed to/from or stored on our site/server. In which case you can bypass the SSL. correct?

#70 insaini

  • Community Member
  • 205 posts
  • Real Name:Jesse B.
  • Gender:Male
  • Location:Brampton, Ontario

Posted 07 June 2008, 10:44

View Postroback, on Jun 5 2008, 08:32 PM, said:

Running payments through PayPal Standard so no secure info is passed to/from or stored on our site/server. In which case you can bypass the SSL. correct?

Ahh ok.. makes sense.. but then i guess thats where the tradeoff is.. to make use of automated labels.. you are passing security information to canadapost servers where you have your creditcard information stored.. but even still.. the problem is when you login into canadapost shipping label application.. its done over https .. not http .. it wont work with http calls.. only https .. so you will definitely need SSL.

How much difference is there in an SSL hosting plan.. thats kinda weird.. who are you hosting with? .. im with godaddy but an SSL certificate costs $20 and you can use with i think any plan.. although im on a virtual dedicated server.. not a shared plan and no one recommends their shared plans..

J

#71 royfra

  • Community Member
  • 13 posts
  • Real Name:Francis

Posted 19 June 2008, 17:12

Hello and thanks for that great contrib.

I have a problem when I submit the label in the admin. I receive this message :

[img]http://74.54.252.146/~royfra23/ftp/2008-06-19_130431.jpg[/img]

Also, does the shipping method should not be the one that the customer choose in his checkout process?

thanks to all

#72 bjcworks

  • Community Member
  • 11 posts
  • Real Name:Byron
  • Gender:Male
  • Location:Nanaimo, BC

Posted 21 June 2008, 01:41

Thanks for great contribution but I have run into a small problem. I have reviewed the forum posts but haven't found a similar issue noted anywhere.

I am able to login to CP, i.e. I have received the "Step 2. Logged In." message. When the program moves onto Step 3, I receive a 404 Error, URI not found. I have turned on debug and the URL that was submitted is as follows:

https://sso-cal.canadapost-postescanada.ca

HTTP/1.1 404 Not Found
Date: Fri, 20 Jun 2008 21:59:17 GMT
Content-Length: 1214
Content-Type: text/html
Connection: close
........ I didn't include the text between ..............
</FONT><P><FONT FACE="Courier New">The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.</p><p>If the server does not wish to make this information available to the client, the status code 403 (Forbidden) can be used instead. The 410 (Gone) status code SHOULD be used if the server knows, through some internally configurable mechanism, that an old resource is permanently unavailable and has no forwarding address.</FONT></P>

I reviewed the Case 3 code in ship_canadapost_ajax.php:

case 3:
// curl init
$ch = cp_setup(false);
$response = cp_submit_page($ch, $response, SSO);
$response = cp_submit_page($ch, $response);
curl_close($ch);

I am wondering about the 2nd arg, "$response" in the 1st cp_submit_page call, how is this arg initialized because that arg is used to expand the URL?

I will dig into this in more detail but I am hoping you can give me guidance in what to research.

Regards

#73 insaini

  • Community Member
  • 205 posts
  • Real Name:Jesse B.
  • Gender:Male
  • Location:Brampton, Ontario

Posted 22 June 2008, 20:24

View Postroyfra, on Jun 19 2008, 01:12 PM, said:

Hello and thanks for that great contrib.

I have a problem when I submit the label in the admin. I receive this message :

[img]http://74.54.252.146/~royfra23/ftp/2008-06-19_130431.jpg[/img]

Also, does the shipping method should not be the one that the customer choose in his checkout process?

thanks to all


Roy.. you will have to convert the English language files for ship_canadapost.php to french.. since I didnt provide the french language file.. its unable to locate it and thats why you are getting those errors...

#74 insaini

  • Community Member
  • 205 posts
  • Real Name:Jesse B.
  • Gender:Male
  • Location:Brampton, Ontario

Posted 22 June 2008, 20:28

View Postbjcworks, on Jun 20 2008, 09:41 PM, said:

Thanks for great contribution but I have run into a small problem. I have reviewed the forum posts but haven't found a similar issue noted anywhere.

I am able to login to CP, i.e. I have received the "Step 2. Logged In." message. When the program moves onto Step 3, I receive a 404 Error, URI not found. I have turned on debug and the URL that was submitted is as follows:

https://sso-cal.canadapost-postescanada.ca

HTTP/1.1 404 Not Found
Date: Fri, 20 Jun 2008 21:59:17 GMT
Content-Length: 1214
Content-Type: text/html
Connection: close
........ I didn't include the text between ..............
</FONT><P><FONT FACE="Courier New">The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.</p><p>If the server does not wish to make this information available to the client, the status code 403 (Forbidden) can be used instead. The 410 (Gone) status code SHOULD be used if the server knows, through some internally configurable mechanism, that an old resource is permanently unavailable and has no forwarding address.</FONT></P>

I reviewed the Case 3 code in ship_canadapost_ajax.php:

case 3:
// curl init
$ch = cp_setup(false);
$response = cp_submit_page($ch, $response, SSO);
$response = cp_submit_page($ch, $response);
curl_close($ch);

I am wondering about the 2nd arg, "$response" in the 1st cp_submit_page call, how is this arg initialized because that arg is used to expand the URL?

I will dig into this in more detail but I am hoping you can give me guidance in what to research.

Regards


Byron.. that is very interesting.. today is sunday and i created two labels just today that went through just fine.. why you are getting that error doesnt make sense to me..

but to begin with I need to verify your curl build .. can you go to admin->tools->server info and look up the curl build .. and post how its been built..

as for the $response variable.. this is maintained in the session between requests.. you can see where this is happening near the top of the file..

J

#75 Motley_17

  • Community Member
  • 17 posts
  • Real Name:Scott Smith

Posted 23 June 2008, 06:45

I get all the options: Priority Courier, Expedited, and Regular, and prices etc., but when no matter wich one is clicked on it defaults to the regual shipping.
There is also only blue highlighted lines. Is there a way of inserting radio buttons?

Thanks for the help.

#76 Bors

  • Community Member
  • 22 posts
  • Real Name:Bors Mistral

Posted 24 June 2008, 18:19

Hello and thanks for this contrib. I only hope I manage to get it working, since I'm quite the noob.
Now I kindly ask you to excuse my ignorance and answer a few potentially stupid question that I have.

First, I don't exactly understand the cookie part:
define (COOKIE_FILE, '/home/user/cookies/cp_cookies');
define (USER_AGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6');
What is "/home/user"? Do I have to set any specific permission for the cp_cookies folder?

Also - is the Automated Labels part supposed the show up somewhere in the admin panel? I can't seem to find it.

#77 bjcworks

  • Community Member
  • 11 posts
  • Real Name:Byron
  • Gender:Male
  • Location:Nanaimo, BC

Posted 25 June 2008, 16:30

View Postinsaini, on Jun 22 2008, 09:28 PM, said:

Byron.. that is very interesting.. today is sunday and i created two labels just today that went through just fine.. why you are getting that error doesnt make sense to me..

but to begin with I need to verify your curl build .. can you go to admin->tools->server info and look up the curl build .. and post how its been built..

as for the $response variable.. this is maintained in the session between requests.. you can see where this is happening near the top of the file..

J
Thanks for getting back to me Jesse.

When Hostgator originally compiled libcurl for me they retrograded our PHP version back to 4. Yesterday I requested them to reestablish PHP 5.2.6. So that happened and the following is our libcurl compilation:

libcurl/7.18.2 OpenSSL/0.9.7a zlib/1.2.3 libidn/0.5.6 libssh2/0.18

I tried another test and I am having less success now because the login within Step 2 is failing with:

https://sso-cal.canadapost-postescanada.ca/.../login/redirect

HTTP/1.1 500 Internal Server Error
Date: Wed, 25 Jun 2008 16:20:29 GMT
Content-Length: 82
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie: JSESSIONID=84hjLvwNGPvGMmLygvpglwml1jrfn4ZJyWn2hBJTnykjKtqWsyzW!-1464866007; path=/
Cache-Control: no-cache, no-store

<html><body>
<form name=Login action="/sso/login.jsp?~language=EN" method=POST>

So I am checking through everything to see if I created my own problem. Do you have any ideas?

Regards,
Byron

#78 insaini

  • Community Member
  • 205 posts
  • Real Name:Jesse B.
  • Gender:Male
  • Location:Brampton, Ontario

Posted 30 June 2008, 15:59

View PostBors, on Jun 24 2008, 02:19 PM, said:

Hello and thanks for this contrib. I only hope I manage to get it working, since I'm quite the noob.
Now I kindly ask you to excuse my ignorance and answer a few potentially stupid question that I have.

First, I don't exactly understand the cookie part:
define (COOKIE_FILE, '/home/user/cookies/cp_cookies');
define (USER_AGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6');
What is "/home/user"? Do I have to set any specific permission for the cp_cookies folder?

Also - is the Automated Labels part supposed the show up somewhere in the admin panel? I can't seem to find it.

Yes.. I think I do mention that the cookie file has to be set correctly in the instructions.. if I dont then I do apologize .. you must create a directory just outside of your public www root folder called cp_cookies or whaever you like.. and place the correct path at this config setting.. its needed to store the cookie file between requests

THe automated labels is loaded via a link on your order page.. so pull up the details of an order.. and the button should be at the bottom of the page SHIP

For configuration of Automated Labels.. thats done via the shipping module

Edited by insaini, 30 June 2008, 16:00.


#79 insaini

  • Community Member
  • 205 posts
  • Real Name:Jesse B.
  • Gender:Male
  • Location:Brampton, Ontario

Posted 30 June 2008, 16:02

View Postbjcworks, on Jun 25 2008, 12:30 PM, said:

Thanks for getting back to me Jesse.

When Hostgator originally compiled libcurl for me they retrograded our PHP version back to 4. Yesterday I requested them to reestablish PHP 5.2.6. So that happened and the following is our libcurl compilation:

libcurl/7.18.2 OpenSSL/0.9.7a zlib/1.2.3 libidn/0.5.6 libssh2/0.18

I tried another test and I am having less success now because the login within Step 2 is failing with:

https://sso-cal.canadapost-postescanada.ca/.../login/redirect

HTTP/1.1 500 Internal Server Error
Date: Wed, 25 Jun 2008 16:20:29 GMT
Content-Length: 82
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie: JSESSIONID=84hjLvwNGPvGMmLygvpglwml1jrfn4ZJyWn2hBJTnykjKtqWsyzW!-1464866007; path=/
Cache-Control: no-cache, no-store

<html><body>
<form name=Login action="/sso/login.jsp?~language=EN" method=POST>

So I am checking through everything to see if I created my own problem. Do you have any ideas?

Regards,
Byron

Hmm.. i have to make a couple shipments today.. i havent since last week.. they may have changed something so ill check and see my side..

#80 Bors

  • Community Member
  • 22 posts
  • Real Name:Bors Mistral

Posted 16 July 2008, 17:52

Thanks again for the module.

The Sellonline part works like a charm.

I'm however stuck at step 2 in the Automated Labels, with the

Quote

Step 2. Error: Failed check in /var/www/virtual/luello.com/htdocs/shop/admin/includes/languages/english/ship_canadapost.php at line 9. This most likely means that Canada Post has changed their user interface. You need to update your Canada Post Automatic Shipping Labels module.
Now, my cURL is libcurl/7.15.5 OpenSSL/0.9.8c zlib/1.2.3 libidn/0.6.5 which I guess means I'm out of luck...

So, is there a reliable workaround or do I really need to switch hosting?