Canada Post Automatic Labels
#21
Posted 18 March 2008 - 12:42 AM
================================
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
Posted 27 March 2008 - 12:54 PM
Next Version up will be released soon. Canada Post Automated Labels AJAX.
Includes Real-Time progress updates and some extra options.
#23
Posted 10 April 2008 - 08:20 PM
==================================
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
Posted 20 June 2008 - 12:45 PM
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
Posted 26 June 2008 - 01:12 AM
Francis
#26
Posted 12 May 2009 - 08:15 PM
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
Posted 20 May 2009 - 01:12 PM
#28
Posted 01 June 2009 - 05:38 AM
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
Posted 01 June 2009 - 07:58 AM
#31
Posted 01 June 2009 - 06:56 PM
Kagonesti, on Jun 1 2009, 02:45 PM, said:
Thank-you, your help is appreciated.
It should show all modules and their options.
#32
Posted 03 June 2009 - 06:04 AM
natrium42, on Jun 1 2009, 06:56 PM, said:
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
Posted 12 June 2009 - 07:18 PM
"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
Posted 14 June 2009 - 05:40 AM
#35
Posted 15 June 2009 - 05:42 PM
Thanks
#36
Posted 16 June 2009 - 12:55 AM
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
Posted 18 June 2009 - 04:05 AM
#38
Posted 23 June 2009 - 10:47 AM
Thanks
#39
Posted 29 June 2009 - 07:32 PM
#40
Posted 30 June 2009 - 12:36 AM
csaxvik, on Jun 29 2009, 03:32 PM, said:
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?









