dandelion Posted May 21, 2009 Share Posted May 21, 2009 Well after 6 hours of working on this I managed to fix the xml parsing error ... shop postal code wasn't entered correctly in the backend configuration shipping/packaging. Such a relief to get it working and so frustrating that it ate up so much time for something so simple. Now only problem is in the automated labels I get an error Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /hsphere/local/home/mysite.com/catalog/admin/includes/languages/english/ship_canadapost.php on line 38 Can anyone help me? Quote Link to comment Share on other sites More sharing options...
lihusxue Posted May 27, 2009 Share Posted May 27, 2009 After I installed Canada Post Automated Labels 2.0, I couldn't pass step2. I read some of the messages here, I thought I missed libssh2 too. I contacted with my host, they said I have it. After that I read all the messages there. I changed the 'case 2' of ship_canadapost_ajax.php according to the message from Alexei Karpenko http://www.oscommerce.com/forums/index.php?sho...78107&st=20. Now I still can not pass step 2. I put the debug mode, I can see I got the response, but it didn't contain <input type=hidden name="SSO_VERSION_MAJOR" value="3">, that's why it failed on the following line of ship_canadapost_ajax.php // 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.'); } I noticed that there is similar check on the other steps, but I don't think I got those in the response(I commoned out those line to see what is the response). By the way, the response is not error, it was html file, and if I commoned out those check lines, I could get pdf file(yesterday I can see the content, but not today), but it still failed on step 8 today. Does anybody please help me? I appreciate it. Quote Link to comment Share on other sites More sharing options...
dandelion Posted May 27, 2009 Share Posted May 27, 2009 For those having problem with the new log in procedure : http://www.oscommerce.com/forums/index.php?sho...78107&st=20 I'm really missing something here... that code doesn't exist in my files to replace??? and I'm still getting this error Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /hsphere/local/home/site-removed/admin/includes/languages/english/ship_canadapost.php on line 38 Quote Link to comment Share on other sites More sharing options...
dandelion Posted May 27, 2009 Share Posted May 27, 2009 I'm really missing something here... that code doesn't exist in my files to replace??? and I'm still getting this error Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /hsphere/local/home/site-removed/admin/includes/languages/english/ship_canadapost.php on line 38 fixed the warning error I now just have the Failed check error This most likely means that Canada Post has changed their user interface. You need to update your Canada Post Automatic Shipping Labels module. HELP PLEASE Quote Link to comment Share on other sites More sharing options...
[email protected] Posted May 29, 2009 Share Posted May 29, 2009 I recently installed this contribution, and I think that I've got everything working now (except for the newest change to Canada Posts Interface). Step 2. Error: Failed check in /home/********/public_html/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. What I had before: $curl -V curl 7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 lib Protocols: tftp ftp telnet dict ldap http file https ftps Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz What I have now: $curl -V curl 7.19.5 (i686-pc-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 libssh2/0.18 Protocols: tftp ftp telnet dict http file https ftps scp sftp Features: IDN IPv6 Largefile NTLM SSL libz What I had before: // configuration definitions define (ORIGINAL_REFERRER, 'https://est-oee.canadapost-postescanada.ca'); define (SSO, 'https://sso-cal.canadapost-postescanada.ca'); define (PAGE, 'shipping/estShipping.jsp?locale=en_CA&formId='); define (PDF, '/waitingForPDF.jsp?servletName=ParcelMailViewLabelServlet&label=forward&locale=en_CA&language=en_CA'); // step definitions define (START, ORIGINAL_REFERRER.'/'.PAGE.$form_prefix.'0'); define (LOGIN, SSO.'/sso/login/redirect'); define (APPLICATION, ORIGINAL_REFERRER.'/ShippingServlet'); define (TRANSMIT, ORIGINAL_REFERRER.'/ParcelMailTransmitServlet'); define (RESET, ORIGINAL_REFERRER.'/ResetSessionServlet'); What I have now: // configuration definitions define (ORIGINAL_REFERRER, 'https://est-oee.canadapost-postescanada.ca'); define (SSO, 'https://sso-cal.canadapost-postescanada.ca'); define (PAGE, 'shipping/estShipping.jsp?locale=en_CA&formId='); define (PDF, '/waitingForPDF.jsp?servletName=ParcelMailViewLabelServlet&label=forward&locale=en_CA&language=en_CA'); // step definitions define (START, ORIGINAL_REFERRER.'/'.PAGE.$form_prefix.'0'); define (LOGIN, SSO.'/cpid/login/redirect'); define (APPLICATION, ORIGINAL_REFERRER.'/ShippingServlet'); define (TRANSMIT, ORIGINAL_REFERRER.'/ParcelMailTransmitServlet'); define (RESET, ORIGINAL_REFERRER.'/ResetSessionServlet'); What I had before: // login post vars $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(MODULE_SHIPPING_CANADAPOST_USERID) . '&SSO_PASSWORD=' . urlencode(MODULE_SHIPPING_CANADAPOST_PASSWORD); // curl init $ch = cp_setup(false); $response = cp_post_page($ch, LOGIN, $query_string); curl_close($ch); // Canada Post customer number $regexp = "SSO_CUSTOMER_NUMBER\" value=\"([0123456789]*)(,|\")"; $matches = ''; preg_match("/$regexp/siU", $response, $matches); if (!tep_session_is_registered('cp_customer')) { tep_session_register('cp_customer'); } $cp_customer = $matches[1]; // progress update if (strstr($response, '<input type=hidden name="SSO_VERSION_MAJOR" value="3">') === FALSE) { do_cp_error($step, SC_GENERAL_ERROR); } else { cp_progress($step, LOGGEDIN); } break; What I have now: case 2: // login post vars $query_string = 'SHOP=CPFRCOMM&SSO_ITS_URL=%2Fcpid%2login%2FsignIn%3F&SSO_ACTION=0&P_SHOP=CPFRCOMM' . '&login_type=2&password_length=0&language=EN&APP_ID=B2B' . '&SSO_USERID=' . urlencode(MODULE_SHIPPING_CANADAPOST_USERID) . '&SSO_PASSWORD=' . urlencode(MODULE_SHIPPING_CANADAPOST_PASSWORD); // curl init $ch = cp_setup(false); $response = cp_post_page($ch, LOGIN, $query_string); curl_close($ch); // Canada Post customer number $regexp = "SSO_CUSTOMER_NUMBER\" value=\"([0123456789]*)(,|\")"; $matches = ''; preg_match("/$regexp/siU", $response, $matches); if (!tep_session_is_registered('cp_customer')) { tep_session_register('cp_customer'); } $cp_customer = $matches[1]; // progress update if (strstr($response, '<input type=hidden name="SSO_VERSION_MAJOR" value="3">') === FALSE) { do_cp_error($step, SC_GENERAL_ERROR); } else { cp_progress($step, LOGGEDIN); } break; If you see what it is that needs to be changed, certainly help me out as well as everyone else who is in need of this solution. The one other issue I have, is that it doesn't seem to calculate the weight of the package and I'm not 100% sure if it adjusts the box dimensions if I have a bigger box would be required to ship, etc. Any feedback would be great. Thank you in advance. Sincerely, Kevin Quote Link to comment Share on other sites More sharing options...
natrium42 Posted May 30, 2009 Share Posted May 30, 2009 Kevin, looks like you forgot the new requests to "https://sso-cal.canadapost-postescanada.ca/cpid/apps/signIn?execution=e1s". Perhaps this would work: case 2: // curl init $ch = cp_setup(false); // new login $response = cp_get_page($ch, SSO.'/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'); // new login form $query_string = 'frmCPIDSignIn:signIn.x=46&frmCPIDSignIn:signIn.y=11&frmCPIDSignIn_SUBMIT=1' . '&frmCPIDSignIn:j_username=' . urlencode(MODULE_SHIPPING_CANADAPOST_USERID) . '&frmCPIDSignIn:j_password=' . urlencode(MODULE_SHIPPING_CANADAPOST_PASSWORD); $response = cp_post_page($ch, SSO.'/cpid/apps/signIn?execution=e1s1', $query_string); // login post vars $query_string = 'SHOP=CPFRCOMM&SSO_ITS_URL=%2Fcpid%2login%2FsignIn%3F&SSO_ACTION=0&P_SHOP=CPFRCOMM' . '&login_type=2&password_length=0&language=EN&APP_ID=B2B' . '&SSO_USERID=' . urlencode(MODULE_SHIPPING_CANADAPOST_USERID) . '&SSO_PASSWORD=' . urlencode(MODULE_SHIPPING_CANADAPOST_PASSWORD); $response = cp_post_page($ch, LOGIN, $query_string); curl_close($ch); // Canada Post customer number $regexp = "SSO_CUSTOMER_NUMBER\" value=\"([0123456789]*)(,|\")"; $matches = ''; preg_match("/$regexp/siU", $response, $matches); if (!tep_session_is_registered('cp_customer')) { tep_session_register('cp_customer'); } $cp_customer = $matches[1]; // progress update if (strstr($response, '<input type=hidden name="SSO_VERSION_MAJOR" value="3">') === FALSE) { do_cp_error($step, SC_GENERAL_ERROR); } else { cp_progress($step, LOGGEDIN); } break; Quote Link to comment Share on other sites More sharing options...
[email protected] Posted June 1, 2009 Share Posted June 1, 2009 Kevin, looks like you forgot the new requests to "https://sso-cal.canadapost-postescanada.ca/cpid/apps/signIn?execution=e1s". Natrium... I tried your code and unfortunately it didn't work for me. If you spot anything else, let me know and thanks for trying to help me out. Sincerely, Kevin Quote Link to comment Share on other sites More sharing options...
natrium42 Posted June 1, 2009 Share Posted June 1, 2009 Hmm, ok... I don't really run this version of the mod, so I can't test the code. You could try enable debugging by setting $debug = 1 and see at the responses from the Canada Post website. You can compare it to the POST/GET requests that you get if you use the Canada Post site directly using Firebug in Firefox. The way this mod works is it just uses the Canada Post website as you would manually -- Canada Post has no way to see that it's actually a script. Quote Link to comment Share on other sites More sharing options...
[email protected] Posted June 1, 2009 Share Posted June 1, 2009 (edited) This is where I am at with my ~/public_html/admin/ship_canadapost_ajax.php file. Step 2. Error: Failed check in /home/********/public_html/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. // configuration definitions define (ORIGINAL_REFERRER, 'https://est-oee.canadapost-postescanada.ca'); define (SSO, 'https://sso-cal.canadapost-postescanada.ca'); define (PAGE, 'shipping/estShipping.jsp?locale=en_CA&formId='); define (PDF, '/waitingForPDF.jsp?servletName=ParcelMailViewLabelServlet&label=forward&locale=en_CA&language=en_CA'); // step definitions define (START, ORIGINAL_REFERRER.'/'.PAGE.$form_prefix.'0'); define (LOGIN, SSO.'/cpid/login/redirect'); define (APPLICATION, ORIGINAL_REFERRER.'/ShippingServlet'); define (TRANSMIT, ORIGINAL_REFERRER.'/ParcelMailTransmitServlet'); define (RESET, ORIGINAL_REFERRER.'/ResetSessionServlet'); My code for Step 2 case 2: // curl init $ch = cp_setup(false); // new login $response = cp_get_page($ch, SSO.'/cpid/apps/signIn?APP_ID=B2B&SSO_REFERRER_URL=https://obc.canadapost.ca/zcpb2b/b2b/init.do?LOCAL=en_CA&language=EN&shop=CPENCOMM'); // new login form $query_string = 'frmCPIDSignIn:signIn.x=46&frmCPIDSignIn:signIn.y=11&frmCPIDSignIn_SUBMIT=1' . '&frmCPIDSignIn:j_username=' . urlencode(MODULE_SHIPPING_CANADAPOST_USERID) . '&frmCPIDSignIn:j_password=' . urlencode(MODULE_SHIPPING_CANADAPOST_PASSWORD); $response = cp_post_page($ch, SSO.'/cpid/apps/signIn?execution=e3s1', $query_string); // login post vars $query_string = 'SHOP=CPENCOMM&SSO_ITS_URL=%2Fcpid%2apps%2FsignIn&SSO_ACTION=0&P_SHOP=CPENCOMM' . '&login_type=2&password_length=0&language=EN&APP_ID=B2B' . '&SSO_USERID=' . urlencode(MODULE_SHIPPING_CANADAPOST_USERID) . '&SSO_PASSWORD=' . urlencode(MODULE_SHIPPING_CANADAPOST_PASSWORD); $response = cp_post_page($ch, LOGIN, $query_string); curl_close($ch); // Canada Post customer number $regexp = "SSO_CUSTOMER_NUMBER\" value=\"([0123456789]*)(,|\")"; $matches = ''; preg_match("/$regexp/siU", $response, $matches); if (!tep_session_is_registered('cp_customer')) { tep_session_register('cp_customer'); } $cp_customer = $matches[1]; // progress update if (strstr($response, '<input type=hidden name="SSO_VERSION_MAJOR" value="3">') === FALSE) { do_cp_error($step, SC_GENERAL_ERROR); } else { cp_progress($step, LOGGEDIN); } break; Sometimes it times out and gives me a SQL time out error, is this normal? Step 2 2006 - MySQL server has gone away select count(*) as total from sessions where sesskey = '4b26f607a76ab414a36dd3488590bc3e' [TEP STOP] . Error: Failed check in /home/********/public_html/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. Can anyone suggest a handy CentOS utility (like a proxy server) so that I can see the request and the responses that happen during the curl process from within a shell account? Thank you in advance for all of your help and for any of your suggestions. Sincerely, Kevin Edited June 1, 2009 by [email protected] Quote Link to comment Share on other sites More sharing options...
dandelion Posted June 3, 2009 Share Posted June 3, 2009 Well I'm almost there... but the expedited and regular shipping are the same price - Canada Post says the problem is with our shopping cart. Does anyone know what I need to change? Canada Post [1 box(es) to be shipped] small - 0.6(kg) Priority Courier, EDD: June 05, 2009 $16.58CA Expedited, EDD: June 05, 2009 $7.03CA Regular, EDD: June 09, 2009 $7.03CA PLEASE HELP ASAP! The site was suppose to go live yesterday! Quote Link to comment Share on other sites More sharing options...
dandelion Posted June 3, 2009 Share Posted June 3, 2009 (edited) This is where I am at with my ~/public_html/admin/ship_canadapost_ajax.php file. Step 2. Error: Failed check in /home/********/public_html/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. // configuration definitions define (ORIGINAL_REFERRER, 'https://est-oee.canadapost-postescanada.ca'); define (SSO, 'https://sso-cal.canadapost-postescanada.ca'); define (PAGE, 'shipping/estShipping.jsp?locale=en_CA&formId='); define (PDF, '/waitingForPDF.jsp?servletName=ParcelMailViewLabelServlet&label=forward&locale=en_CA&language=en_CA'); // step definitions define (START, ORIGINAL_REFERRER.'/'.PAGE.$form_prefix.'0'); define (LOGIN, SSO.'/cpid/login/redirect'); define (APPLICATION, ORIGINAL_REFERRER.'/ShippingServlet'); define (TRANSMIT, ORIGINAL_REFERRER.'/ParcelMailTransmitServlet'); define (RESET, ORIGINAL_REFERRER.'/ResetSessionServlet'); ... Kevin Sorry I'm probably wrong as I am in over my head but are your defines missing the first two ' ? Like this... define ('ORIGINAL_REFERRER', 'https://est-oee.canadapost-postescanada.ca'); define ('SSO', 'https://sso-cal.canadapost-postescanada.ca'); define ('PAGE', 'shipping/estShipping.jsp?locale=en_CA&formId='); define ('PDF', '/waitingForPDF.jsp?servletName=ParcelMailViewLabelServlet&label=forward&locale=en_CA&language=en_CA'); Edited June 3, 2009 by dandelion Quote Link to comment Share on other sites More sharing options...
dandelion Posted June 3, 2009 Share Posted June 3, 2009 can someone please upload a full package here http://addons.oscommerce.com/info/5842 with the changes? Then I will be able to compare files and see what I'm missing to get the automated labels fixed. Thanks Also does anyone know what is wrong that would cause the expedited and regular prices to be the same and to be too much? Quote Link to comment Share on other sites More sharing options...
natrium42 Posted June 4, 2009 Share Posted June 4, 2009 Also does anyone know what is wrong that would cause the expedited and regular prices to be the same and to be too much? As far as I know, the prices for Regular and Expedited are exactly the same for VentureOne customers. I would just disable Regular to Canada entirely. Quote Link to comment Share on other sites More sharing options...
[email protected] Posted June 4, 2009 Share Posted June 4, 2009 Sorry I'm probably wrong as I am in over my head but are your defines missing the first two ' ? Like this... define ('ORIGINAL_REFERRER', 'https://est-oee.canadapost-postescanada.ca'); define ('SSO', 'https://sso-cal.canadapost-postescanada.ca'); define ('PAGE', 'shipping/estShipping.jsp?locale=en_CA&formId='); define ('PDF', '/waitingForPDF.jsp?servletName=ParcelMailViewLabelServlet&label=forward&locale=en_CA&language=en_CA'); Dandelion: Sorry for the lateness of my reply. I really appreciate your effort in trying to resolve my issue. (That's not the solution, but good try.) I'm not sure if you've noticed... but your latest issue is my issue. :) Hopefully we'll get it resolved soon... I've been trying to work with someone from Canada Post to try and resolve it sooner rather than later. Sincerely, Kevin Quote Link to comment Share on other sites More sharing options...
syn0ptic Posted June 15, 2009 Share Posted June 15, 2009 (edited) Dandelion: Sorry for the lateness of my reply. I really appreciate your effort in trying to resolve my issue. (That's not the solution, but good try.) I'm not sure if you've noticed... but your latest issue is my issue. :) Hopefully we'll get it resolved soon... I've been trying to work with someone from Canada Post to try and resolve it sooner rather than later. Sincerely, Kevin any update on this problem ? I cant find what to do to fix the login process but I got this error in debug mode : https://sso-cal.canadapost-postescanada.ca/.../login/redirect HTTP/1.1 502 Bad Gateway Server: Sun-Java-System-Web-Server/7.0 Date: Mon, 15 Jun 2009 20:08:42 GMT Transfer-encoding: chunked <HTML><HEAD><TITLE>Bad Gateway</TITLE></HEAD> <BODY><H1>Bad Gateway</H1> Processing of this request was delegated to a server that is not functioning properly. </BODY></HTML> Edited June 15, 2009 by syn0ptic Quote Link to comment Share on other sites More sharing options...
syn0ptic Posted June 17, 2009 Share Posted June 17, 2009 PROBLEM WITH LOGIN FIXED ! See update in the contrib page : http://addons.oscommerce.com/info/5842 Quote Link to comment Share on other sites More sharing options...
[email protected] Posted June 18, 2009 Share Posted June 18, 2009 PROBLEM WITH LOGIN FIXED ! See update in the contrib page : http://addons.oscommerce.com/info/5842 Thank you... I've been waiting for over a week for our Canada Post Representative to get back to me with the fix. Quote Link to comment Share on other sites More sharing options...
natrium42 Posted June 18, 2009 Share Posted June 18, 2009 I've been waiting for over a week for our Canada Post Representative to get back to me with the fix. I doubt that Canada Post would support what is basically a hack. They do not provide any API for programmers to ship online. Quote Link to comment Share on other sites More sharing options...
johanv Posted June 23, 2009 Share Posted June 23, 2009 Hi all, I am running this module, I am running into an issue. This morning I had a sale, the module returned the sale's shipping costs at $11.80. Each item sold was L 26 cm x W 26 cm x H 2 cm @ .2 kg. I have the option ship in its original packaging checked, but the invoice stated that two boxes would be shipped. I am shipping them wrapped together, and not in a box. So I am wondering if there is a way to accomplish that via this module? BTW the Canada Post website calculated the shipping at $6.31 total. Mucho gracias Quote Link to comment Share on other sites More sharing options...
johanv Posted June 23, 2009 Share Posted June 23, 2009 I have the same issue with the labels and Step 2. I have verified that everything with my webhost is setup correctly. Would this have anything to do with my CC not being entered in the module setup within administration? I am running out of ideas on how to trouble shoot this. Quote Link to comment Share on other sites More sharing options...
Patrick73 Posted June 30, 2009 Share Posted June 30, 2009 I have the same issue with the labels and Step 2. I have verified that everything with my webhost is setup correctly. Would this have anything to do with my CC not being entered in the module setup within administration? I am running out of ideas on how to trouble shoot this. There seems to have been a modification with the Canada posts website log in as of june 29th. I'm running in to the same problem. Most likely someone will post a fix in a little bit. Quote Link to comment Share on other sites More sharing options...
csaxvik Posted June 30, 2009 Share Posted June 30, 2009 (edited) I think the canadapost.com logins fields got updated last few days so that has messed it up for all of us. Yes, let's hope there is a lovely "someone" out there who can rescue us asap. Edited June 30, 2009 by csaxvik Quote Link to comment Share on other sites More sharing options...
csaxvik Posted July 2, 2009 Share Posted July 2, 2009 Look in the Canada Post forum by Natrium. He has posted a fix as CP changed the login field names slightly Quote Link to comment Share on other sites More sharing options...
johanv Posted July 5, 2009 Share Posted July 5, 2009 Look in the Canada Post forum by Natrium. He has posted a fix as CP changed the login field names slightly Hey christian, What forum are you talking about? Maybe you can post the link to the fix? Thanks, Jonathon Quote Link to comment Share on other sites More sharing options...
syn0ptic Posted July 7, 2009 Share Posted July 7, 2009 Hey christian, What forum are you talking about? Maybe you can post the link to the fix? Thanks, Jonathon here http://www.oscommerce.com/forums/index.php?s=&...t&p=1416027 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.