Jump to content



Latest News: (loading..)

- - - - -

Canada Post Automatic Labels


  • Please log in to reply
68 replies to this topic

#21   natrium42

natrium42
  • Members
  • 142 posts
  • Real Name:Alexei Karpenko

Posted 18 March 2008 - 12:42 AM

Canada Post Automatic Labels 1.2
================================

Version 1.2 (2008-03-17)
- bugfix: missing weight for domestic shipments
- added clear buttons to customs form
- fixed customs form such that >6 items are modifiable (Canada Post still only accepts the first 6)
- added splitter for long address lines into address1 and address2

Please see http://addons.oscommerce.com/info/5445 to download

#22   insaini

insaini
  • Members
  • 208 posts
  • Real Name:Jesse B.
  • Gender:Male
  • Location:Brampton, Ontario

Posted 27 March 2008 - 12:54 PM

To All,

Next Version up will be released soon. Canada Post Automated Labels AJAX.

Includes Real-Time progress updates and some extra options.

#23   natrium42

natrium42
  • Members
  • 142 posts
  • Real Name:Alexei Karpenko

Posted 10 April 2008 - 08:20 PM

Canada Post Automatic Labels 1.2.1
==================================

Version 1.2.1 (2008-04-10)
- Canada Post changed ID for Intl Small Packets Air from 000000000000001121 to 000000000000009610
- Canada Post changed ID for Intl Small Packets Surface from 000000000000001122 to 000000000000009611

Next version should remove these hard-coded values so that Canada Post is free to change them without any changes required to this module.

Please see http://addons.oscommerce.com/info/5445 to download

#24   royfra

royfra
  • Members
  • 13 posts
  • Real Name:Francis

Posted 20 June 2008 - 12:45 PM

hello ! thanks for that great contrib.

How do I edit the custom form? The "clear" and "customize shipment" options does not seams to work? I would like to edit the value in it.

Here's a screenshot.

[img]http://gator418.hostgator.com/~royfra23/ftp/2008-06-20_083558.jpg[/img]

Also, how do I avoid clear text tranmission of my cc infos.?

thanks for your help!
Francis Roy

#25   royfra

royfra
  • Members
  • 13 posts
  • Real Name:Francis

Posted 26 June 2008 - 01:12 AM

any help appreciated.
Francis

#26   natrium42

natrium42
  • Members
  • 142 posts
  • Real Name:Alexei Karpenko

Posted 12 May 2009 - 08:15 PM

Looks like Canada Post modified the login process slightly. The following change in admin/ship_canadapost.php is required.

Change the following code:
  ////
  // 2. LOG IN
  $response = cp_get_page($ch, 'https://sso-cal.canadapost-postescanada.ca/sso/login.jsp?~language=EN&APP_ID=B2B&SSO_REFERRER_URL=https://obc.canadapost.ca/zcpb2b/b2b/init.do?language=EN&shop=CPENCOMM&sblid=sbobclogin');
  
  $query_string = 'SHOP=CPFRCOMM&SSO_ITS_URL=%2Fsso%2Flogin.jsp&SSO_ACTION=0&P_SHOP=CPFRCOMM'
				. '&login_type=2&password_length=0&%7Elanguage=EN&APP_ID=B2B'
				. '&SSO_USERID=' . urlencode($cp_user)
				. '&SSO_PASSWORD=' . urlencode($cp_password);
				
  $response = cp_post_page($ch, 'https://sso-cal.canadapost-postescanada.ca/sso/login/redirect', $query_string);
  
  // get Canada Post customer number
  $regexp = "SSO_CUSTOMER_NUMBER\" value=\"([0123456789]*)(,|\")";
  $matches = '';
  preg_match("/$regexp/siU", $response, $matches);
  $cp_customer = $matches[1];
	
  $response = cp_submit_page($ch, $response, 'https://sso-cal.canadapost-postescanada.ca');

  // Sanity Check and Progress Report
  if (strstr($response, '<input type=hidden name="SSO_VERSION_MAJOR" value="3">') === FALSE) {
	cp_error(2, 'Failed check in ' . __FILE__ . ' at line ' . __LINE__  . '. This most likely means that Canada Post has changed their user interface. You need to update your Canada Post Automatic Shipping Labels module.');
	curl_close($ch); die(); /////////////////////
  } else {
	cp_progress(2, 'Logged in.');
  }
to the new code:
  ////
  // 2. LOG IN
  
  $response = cp_get_page($ch, 'https://sso-cal.canadapost-postescanada.ca/cpid/apps/signIn?LOCALE=en&~language=EN&APP_ID=B2B&SSO_REFERRER_URL=https://obc.canadapost.ca/zcpb2b/b2b/init.do?language=EN&shop=CPENCOMM');
  
  $query_string = 'frmCPIDSignIn:signIn.x=46&frmCPIDSignIn:signIn.y=11&frmCPIDSignIn_SUBMIT=1'
				. '&frmCPIDSignIn:j_username=' . urlencode($cp_user)
				. '&frmCPIDSignIn:j_password=' . urlencode($cp_password);
					 
  $response = cp_post_page($ch, 'https://sso-cal.canadapost-postescanada.ca/cpid/apps/signIn?execution=e1s1', $query_string);
  
  $query_string = 'SHOP=CPFRCOMM&SSO_ITS_URL=%2Fcpid%2Flogin.jsp&SSO_ACTION=0&P_SHOP=CPFRCOMM'
				. '&login_type=2&password_length=0&%7Elanguage=EN&APP_ID=B2B'
				. '&SSO_USERID=' . urlencode($cp_user)
				. '&SSO_PASSWORD=' . urlencode($cp_password);
				
  $response = cp_post_page($ch, 'https://sso-cal.canadapost-postescanada.ca/cpid/login/redirect', $query_string);
  
  // get Canada Post customer number
  $regexp = "SSO_CUSTOMER_NUMBER\" value=\"([0123456789]*)(,|\")";
  $matches = '';
  preg_match("/$regexp/siU", $response, $matches);
  $cp_customer = $matches[1];
	
  $response = cp_submit_page($ch, $response, 'https://sso-cal.canadapost-postescanada.ca');

  // Sanity Check and Progress Report
  if (strstr($response, '<input type=hidden name="SSO_VERSION_MAJOR" value="3">') === FALSE) {
	cp_error(2, 'Failed check in ' . __FILE__ . ' at line ' . __LINE__  . '. This most likely means that Canada Post has changed their user interface. You need to update your Canada Post Automatic Shipping Labels module.');
	curl_close($ch); die(); /////////////////////
  } else {
	cp_progress(2, 'Logged in.');
  }
Everything should start working again.

#27   royfra

royfra
  • Members
  • 13 posts
  • Real Name:Francis

Posted 20 May 2009 - 01:12 PM

many thanks....it works!!!!: )

#28   Kagonesti

Kagonesti
  • Members
  • 13 posts
  • Real Name:Peter D
  • Gender:Male

Posted 01 June 2009 - 05:38 AM

Thanks for the great Mod.

I'm not sure If the issue has to do with the Canada Post change recently, but this is the error I'm receiving (this is WITH the new #2 mod above):

Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/xxxx/public_html/xxxx/admin/ship_canadapost.php on line 613
Step 1. Initialized.
Step 2. Error: Failed check in /home/xxxx/public_html/xxxx/admin/ship_canadapost.php at line 651. This most likely means that Canada Post has changed their user interface. You need to update your Canada Post Automatic Shipping Labels module.

The warning message makes me wonder if I am missing something.  Ideas?

Thanks.

#29   natrium42

natrium42
  • Members
  • 142 posts
  • Real Name:Alexei Karpenko

Posted 01 June 2009 - 07:58 AM

Hmm, is your curl built with OpenSSL and libssh2?

#30   Kagonesti

Kagonesti
  • Members
  • 13 posts
  • Real Name:Peter D
  • Gender:Male

Posted 01 June 2009 - 06:45 PM

View Postnatrium42, on Jun 1 2009, 07:58 AM, said:

Hmm, is your curl built with OpenSSL and libssh2?

I'm not sure...  How would I find out?  I didn't see anything regarding this in cpanel.

Thank-you, your help is appreciated.

#31   natrium42

natrium42
  • Members
  • 142 posts
  • Real Name:Alexei Karpenko

Posted 01 June 2009 - 06:56 PM

View PostKagonesti, on Jun 1 2009, 02:45 PM, said:

I'm not sure...  How would I find out?  I didn't see anything regarding this in cpanel.

Thank-you, your help is appreciated.
Just create a php file with phpinfo() call: http://ca2.php.net/manual/en/function.phpinfo.php
It should show all modules and their options.

#32   Kagonesti

Kagonesti
  • Members
  • 13 posts
  • Real Name:Peter D
  • Gender:Male

Posted 03 June 2009 - 06:04 AM

View Postnatrium42, on Jun 1 2009, 06:56 PM, said:

Just create a php file with phpinfo() call: http://ca2.php.net/manual/en/function.phpinfo.php
It should show all modules and their options.

Perfect..  and it looks like it is enabled.  I'll keep poking at it, and see what I can come up with.  That is, unless you have any other ideas =).  Thanks!

I also found in the osc admin panel, the TOOLS menu also shows this now.  The things you learn..  =)

PHP Version 5.2.9
cURL support enabled
cURL Information libcurl/7.19.4 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5

#33   andreihr

andreihr
  • Members
  • 3 posts
  • Real Name:andrei hrusca

Posted 12 June 2009 - 07:18 PM

Hey guys. I've been trying to add this module and have overcome some problems by looking through these forums but i've come across something and im not sure how to fix it. When i go to ship something it goes through the steps up until step 5 then it gives me the following error:

"Step 5. Error: (1447) The Shipping Point is invalid."

I'm not really sure what could be causing that error and i don't know what information I could give you to help me solve this. When i look at the phpinfo here is the cURL information: " libcurl/7.16.0 OpenSSL/0.9.8i zlib/1.2.3 " i know i don't have libssh2 installed and i thought that you absolutely needed that in order to pass step 2 but it looks like it logged me in without having that added on. Do you think that because i don't have libssh2 this is why it won't go past step 5? or is there something else? any tips or info would be much appreciated.

Thanks

#34   natrium42

natrium42
  • Members
  • 142 posts
  • Real Name:Alexei Karpenko

Posted 14 June 2009 - 05:40 AM

Hmm, are you able to ship manually by using EST? It sounds like your address is not set up.

#35   andreihr

andreihr
  • Members
  • 3 posts
  • Real Name:andrei hrusca

Posted 15 June 2009 - 05:42 PM

Yes I am able to ship normally through EST but il see if I made some wrong settings or something in the address.
Thanks

#36   mr.mister

mr.mister
  • Members
  • 2 posts
  • Real Name:Alex

Posted 16 June 2009 - 12:55 AM

Hi Alexei,

First, thank you for taking the time to make a such a great contribution.

I'm also having the same issue as the Andrei, where it fails at step 5. As far as I know the address is set up correctly in EST - I don't have to re-enter it or correct it in order to complete it.

Is there anyway I can confirm that everything is as it should be on EST?

Thank you,

Alex

#37   natrium42

natrium42
  • Members
  • 142 posts
  • Real Name:Alexei Karpenko

Posted 18 June 2009 - 04:05 AM

What kind of shipping option does this happen with? Is this with domestic shipping? I usually use eShipper to ship domestically, so might have missed a cropped up problem.

#38   andreihr

andreihr
  • Members
  • 3 posts
  • Real Name:andrei hrusca

Posted 23 June 2009 - 10:47 AM

It happens during normal shipping so Expedited. I called Canada post to try to find out something about the error but they said they've never heard of an " Error: (1447) " any ideas?

Thanks

#39   csaxvik

csaxvik
  • Members
  • 23 posts
  • Real Name:christian saxvik

Posted 29 June 2009 - 07:32 PM

Has Canada POst changed the login code again? Anyone else having errors with the login code again from this weekend?

#40   royfra

royfra
  • Members
  • 13 posts
  • Real Name:Francis

Posted 30 June 2009 - 12:36 AM

View Postcsaxvik, on Jun 29 2009, 03:32 PM, said:

Has Canada POst changed the login code again? Anyone else having errors with the login code again from this weekend?


yep ! I got a problem in step 2..... Error: Failed check in /home/r.../catalog/admin/ship_canadapost.php at line 657. This most likely means that Canada Post has changed their user interface. You need to update your Canada Post Automatic Shipping Labels module.

anyone got this problem?