Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Canada Post Automatic Labels


natrium42

Recommended Posts

OK, chatting with Alexei it turns out that OSCommerce/OSCMax are using something called long arrays, which are being phased out of php - they are not going to be available once php 6.0 is released (this needs to be addressed!).

 

So the cure for the undefined variable HTTP_POST_VARS (and HTP_GET_VARS) is to simply replace $HTTP_POST_VARS with $_POST and to replace $HTTP_GET_VARS with $_GET in his contribution which is Canada Post Automatic Labels 1.2.3.

 

BUT NOT for the rest of your OSCMax/Commerce site...for now...

 

I used a good text editor (TextWrangler - MAC) to do the required search & replace and now I get past this problem as shown above, and down to the Payment section, where I have inserted the php code "die();" which terminates the PHP code before making a payment to Canada Post (section 6 as I recall).

 

I'll try to write this up a bit clearer once I have verified that this works for me, and have checked with Alexei - he is very busy right now with exams I believe.

 

John :-#)#

 

Further to this program (1.2.3 version) I have found there is one obsolete section in admin/catagories.php which is this line of code - the link to launch a search page for Harmonized Shipping Codes/Tariffs in catalog/admin/categories.php while in the Add/Edit :

 

-----------------------

***REPLACE this added (1.2.3) code:

 

<td class="main"><a href="http://www.cbsa-asfc.gc.ca/trade-commerce/tariff-tarif/tariff2007/01-99/table-e.html" target="_blank">HS Tariff</a>:</td>

 

******With this code:

 

<td class="main"><a href="http://www.statcan.gc.ca/trade-commerce/cec/trade-commerce-eng.htm" target="_blank">HS Tariff</a>:</td>

 

-----------------------

 

This (when you click on HS Tariffs:) opens a new tab/window for Statistics Canada search "Canadian Export Classification" and you can search for your code using key words (start with a single word) or part of a tariff code - say the first 4 numbers, no "." in the search window.

 

John :-#)#

Link to comment
Share on other sites

  • 1 month later...
  • Replies 68
  • Created
  • Last Reply

Top Posters In This Topic

Canada Post will take multiple items and fit them into one of the boxes you have provided a name and dimensions for. However when the module has successfully finished it does not provide you with the box name that Canada Post used to determine the shipping price!

 

Is there an easy modification to the code so that is one of the returned parameters?

 

Thanks!

 

John :-#)#

Link to comment
Share on other sites

  • 2 months later...

Hi All, I'm really new... so please excuse my newbe questions (I've been lurking here for months... and been able to answer all my question with the search funtion up until now).

 

I've installed this mod on my test site and cannot get past Step 2.

 

Step 1. Initialized.
Step 2. Error: Failed check in /mnt/w0113/d12/s07/b02a2859/www/osc_admin_dev/ship_canadapost.php at line 346. This most likely means that Canada Post has changed their user interface. You need to update your Canada Post Automatic Shipping Labels module.

 

I've tried multiple versions of admin/ship_canadapost.php // 2. LOG IN code... below is what I currently have

 

////
 // 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 = 'cpidSignIn:signIn.x=46&cpidSignIn:signIn.y=11&cpidSignIn_SUBMIT=1'
                               . '&cpidSignIn:j_username=' . urlencode($cp_user)
                               . '&cpidSignIn: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.');
 }

 

Any help would be appreciated....

Link to comment
Share on other sites

I've tried the original code from the install... still the same problem... I now have the below installed...

 

  ////
 // 2. LOG IN

 $response = cp_get_page($ch, 'https://www.canadapost.ca/cpid/login.jsp?SSO_REFERRER_URL=https://www.canadapost.ca');

 $response = cp_get_page($ch, 'https://www.canadapost.ca/cpid/apps/signIn?LOCALE=en');

 $query_string = 'cpidSignIn:signIn.x=46&cpidSignIn:signIn.y=11&cpidSignIn_SUBMIT=1'
               . '&cpidSignIn:j_username=' . urlencode($cp_user)
               . '&cpidSignIn:j_password=' . urlencode($cp_password)
               . '&cpidSignIn:rememberUserName=true'
               . '&destination=https://obc.canadapost.ca/zcpb2b/b2b/init.do';

 $response = cp_post_page($ch, 'https://www.canadapost.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://www.canadapost.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://www.canadapost.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.');
 }

Link to comment
Share on other sites

So I think I've found the answer in another post...

 

Apparently not passing Step 2 is almost always to do with the cURL missing OpenSSL AND! libssh2...

 

Right now my cURL is

cURL support  enabled  
cURL Information  libcurl/7.19.0 OpenSSL/0.9.8k zlib/1.1.3  

 

Just waiting for my host to reconfigure the cURL (it didn't seem like it would be an issue... other than the system admin has to do it and they don't work on the weekend).

Link to comment
Share on other sites

  • 5 months later...

Hi All, I haven't worked on this in a while... but I'm now back working at it again... I have changed hosts and they have compile cURL with libssh2

 

curl

cURL support enabled

cURL Information libcurl/7.21.3 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 libssh2/1.2.7

 

However, I still cannot pass step 2.

 

Step 2. Error: Failed check in /home/********/public_html/osc_admin/ship_canadapost.php at line 347. This most likely means that Canada Post has changed their user interface. You need to update your Canada Post Automatic Shipping Labels module.

 

I sure port 30000 is open... as Canada Post Quotes (I belive) come through port 30000.

 

Enter CanadaPost Server Port

30000

 

So... I'm not sure what this issue is...

 

The only thing I'm not 100% clear on is; what login info do I use?

 

Or the login to EST I presume??? Or the login to sellonline?

 

Right now I'm testing with the EST login info;

 

$cp_user = '<********>';
$cp_password = '<******>';
$cp_contract = '<00********>';          // if you have a CP contract, put it here to pay via
                          // account instead of credit card
$cp_use_account = 1;       // set to 1 to pay via account instead of credit card

 

Any suggestions would be a great help...

 

Currently the the code at step 2 looks like;

 

// 2. LOG IN

 $response = cp_get_page($ch, 'https://www.canadapost.ca/cpid/login.jsp?SSO_REFERRER_URL=https://www.canadapost.ca');

 $response = cp_get_page($ch, 'https://www.canadapost.ca/cpid/apps/signIn?LOCALE=en');

 $query_string = 'cpidSignIn:signIn.x=46&cpidSignIn:signIn.y=11&cpidSignIn_SUBMIT=1'

Link to comment
Share on other sites

Ok, I've got this working... Kinda... It seems I forgot to remove the "<" ">" from the login info.

 

It is creating the lable on the Can Post site... However NOT able to open it.

 

Warning: fopen(http://www.mysite.ca/shop/images/canadapost/611.pdf) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/*******/public_html/osc_admin/ship_canadapost.php on line 755

Warning: fwrite(): supplied argument is not a valid stream resource in /home/*******/public_html/osc_admin/ship_canadapost.php on line 756

Warning: fclose(): supplied argument is not a valid stream resource in /home/*******/public_html/osc_admin/ship_canadapost.php on line 757

 

I have double checked... and I have uploaded and changed the file permission to 777 here; /public_html/osc_admin/images/canadapost/

 

What is funny is the above error is pointing to my "catalog";

 fopen(http://www.mysite.ca/shop/images/canadapost/611.pdf)

Shouldn't it be pointing to;

osc_admin/images/canadapost/

????????

Link to comment
Share on other sites

Ok, I'm new here and very new to php. BUT I managed to figure it out (although I'm certain this is the long way... after hours of trial and error).

 

Below are my edits... just in case it helps someone else (I take no responsibily for these edits... all I can say is they worked for me).

 

In admin/ship_canadapost.php

 

change (on or about line 72);

 

$label_file = DIR_WS_IMAGES . 'canadapost/' . $order_id . '.pdf';

to;

 

$label_file = '/home/******/public_html/admin/images/canadapost/' . $order_id . '.pdf';

 

Change (on or about line 755-757);

 

$fh = fopen($label_file, 'wb');
 fwrite($fh, $response);
 fclose($fh);

to;

 

$fh = fopen('/home/*****/public_html/admin/images/canadapost/' . $order_id . '.pdf', 'wb');
	fwrite($fh, $response);
	fclose($fh);

 

Change (on or about 795);

 

echo '<a href="' . $label_file . '">Open PDF</a></b><br><br>';

to;

 

echo '<b>PDF Label: <a href="' . sprintf(LABEL_FILE,$order_id) . '" target="_blank">Open</a></b><br><br>';

This also opens the label in a new window.

 

In admin/includes/languages/english/ship_canadapost.php

 

add (just below <?php);

 

define('LABEL_FILE', 'http://www.mysite.com/admin/images/canadapost/%s.pdf');

Link to comment
Share on other sites

  • 3 weeks later...

Anyone else getting the error message today?

"

Error: Failed check in ship_canadapost.php at line 347. This most likely means that Canada Post has changed their user interface. You need to update your Canada Post Automatic Shipping Labels module.

"

 

I was having trouble accessing the CP website this morning, but it seems to be available again.

 

Johan

Link to comment
Share on other sites

Anyone else getting the error message today?

"

Error: Failed check in ship_canadapost.php at line 347. This most likely means that Canada Post has changed their user interface. You need to update your Canada Post Automatic Shipping Labels module.

"

 

I was having trouble accessing the CP website this morning, but it seems to be available again.

 

Johan

 

Nevermind, works again.

Link to comment
Share on other sites

  • 1 month later...

I'm getting error at Step 7; it seems like the credit card is being charged but then it crashes somewhere...

 

Step 7. Error: Failed check in .../public_html/shop/admin/ship_canadapost.php at line 740. This most likely means that Canada Post has changed their user interface. You need to update your Canada Post Automatic Shipping Labels module.

 

Any idea what's going on? I just reinstalled this contrib to see if it would fix it but no.

 

I just started to get this error, but on line 738. Was this ever resolved?

Link to comment
Share on other sites

  • 5 months later...

Anyone having trouble with automatic labels today (Sept 26th 2011)???? I'm able to login manually and do labels. But get no joy automatically?

 

I get an error on step 3:

Step 3. Error: Failed check in /home/********/public_html/osc_admin/ship_canadapost.php at line 387. This most likely means that Canada Post has changed their user interface. You need to update your Canada Post Automatic Shipping Labels module.

 

I ship about 20 packages a day and it works 99% of the time... Any ideas?

 

Did Canada Post change their login process? Below is my login code

 // 2. LOG IN
 $response = cp_get_page($ch, 'https://www.canadapost.ca/cpid/login.jsp?SSO_REFERRER_URL=https://www.canadapost.ca');

 $response = cp_get_page($ch, 'https://www.canadapost.ca/cpid/apps/signIn?LOCALE=en');

 $query_string = 'cpidSignIn:signIn.x=46&cpidSignIn:signIn.y=11&cpidSignIn_SUBMIT=1'
		    . '&cpidSignIn:j_username=' . urlencode($cp_user)
		    . '&cpidSignIn:j_password=' . urlencode($cp_password)
		    . '&cpidSignIn:rememberUserName=true'
		    . '&destination=https://obc.canadapost.ca/zcpb2b/b2b/init.do';

 $response = cp_post_page($ch, 'https://www.canadapost.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://www.canadapost.ca/cpid/login/redirect', $query_string);

 

I'm guessing its the last line... But don't know for sure...

Link to comment
Share on other sites

Sorry... I assumed it was the login before even looking... The problem is setting up the form... around here;

 

 $response = cp_get_page($ch, 'https://est-oee.canadapost-postescanada.ca/shipping/estShipping.jsp?locale=en_CA&formId=' . $form_prefix . '0&isV1=true');

 $regexp = "URL=([^\"]*)\"";
 $matches = '';
 preg_match("/$regexp/siU", $response, $matches);
 $url = $matches[1];
 $response = cp_get_page($ch, $url);

 $response = cp_submit_page($ch, $response);

 /**/
 $regexp = "URL=([^\"]*)\"";
 $matches = '';
 preg_match("/$regexp/siU", $response, $matches);
 $url = $matches[1];
 $response = cp_get_page($ch, $url);

 $response = cp_submit_page($ch, $response);
 /**/

 // Sanity Check and Progress Report
 if (stristr($response, '<input type="hidden" name="formId" value="' . $form_prefix . '0">') === FALSE) {
   cp_error(3, '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(3, 'Started shipping application.');
 }

Link to comment
Share on other sites

I am getting this:

 

Error: Failed check in /home/xxxxxxx/public_html/store/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.

 

 

Assuming it has to deal with your post above.

 

Any ideas?

 

D.

Link to comment
Share on other sites

  • 6 months later...

Is this returned when you ship through the Canada Post website? If yes, then it could certainly be parsed out.

 

Here is the Canada Post log for a typical transaction. Note the dimensions do not appear to be getting through to CP - I got very busy right after this came in and forgot to check it out. Now I find that one no longer talks to IBM directly (the CP computer folks) when contacting them (CP) about a technical problem so not sure if I can still get logs.

 

-------------------------(quote - CP log)--------------------------

20:57:04 7254049 Packing constraint [PRIORITY WORLDWIDE CONSTRAINTS]

20:57:04 7254049 ------------------

20:57:04 7254049 Launching 'Weight And Volume Based Packer Thread Engine'

20:57:04 7254049 maxWeight=30.0 kg maxSize=2000x2000x2000 mm maxL+Girth=3000 mm

20:57:04 7254049 Filtering out larg box.

20:57:04 7254049 Box #1 : 'Office Depot #46014-0D 6x6x6' Size=(w,h,d)=152x152x152 mm Weight=0.105 kg Capacity=30.0 lengthPlusGirth=760 mm

20:57:04 7254049 Box #2 : 'Office Depot #46016-0D 12x9x5' Size=(w,h,d)=305x229x127 mm Weight=0.195 kg Capacity=30.0 lengthPlusGirth=1017 mm

20:57:04 7254049 Box #3 : 'Blue Kit Box' Size=(w,h,d)=195x100x60 mm Weight=0.1 kg Capacity=1.0 lengthPlusGirth=515 mm

20:57:05 7254049 ------------------

20:57:05 7254049 Packing constraint [XPRESSPOST USA CONSTRAINTS]

20:57:05 7254049 ------------------

20:57:05 7254049 Launching 'Weight And Volume Based Packer Thread Engine'

20:57:05 7254049 maxWeight=30.0 kg maxSize=2000x2000x2000 mm maxL+Girth=2740 mm

20:57:05 7254049 Filtering out larg box.

20:57:05 7254049 Box #1 : 'Office Depot #46014-0D 6x6x6' Size=(w,h,d)=152x152x152 mm Weight=0.105 kg Capacity=30.0 lengthPlusGirth=760 mm

20:57:05 7254049 Box #2 : 'Office Depot #46016-0D 12x9x5' Size=(w,h,d)=305x229x127 mm Weight=0.195 kg Capacity=30.0 lengthPlusGirth=1017 mm

20:57:05 7254049 Box #3 : 'Blue Kit Box' Size=(w,h,d)=195x100x60 mm Weight=0.1 kg Capacity=1.0 lengthPlusGirth=515 mm

20:57:05 7254049 ------------------

20:57:05 7254049 Packing constraint [EXPEDITED USA CONSTRAINTS]

20:57:05 7254049 ------------------

20:57:05 7254049 Launching 'Weight And Volume Based Packer Thread Engine'

20:57:05 7254049 maxWeight=30.0 kg maxSize=2000x2000x2000 mm maxL+Girth=2740 mm

20:57:05 7254049 Filtering out larg box.

20:57:05 7254049 Box #1 : 'Office Depot #46014-0D 6x6x6' Size=(w,h,d)=152x152x152 mm Weight=0.105 kg Capacity=30.0 lengthPlusGirth=760 mm

20:57:05 7254049 Box #2 : 'Office Depot #46016-0D 12x9x5' Size=(w,h,d)=305x229x127 mm Weight=0.195 kg Capacity=30.0 lengthPlusGirth=1017 mm

20:57:05 7254049 Box #3 : 'Blue Kit Box' Size=(w,h,d)=195x100x60 mm Weight=0.1 kg Capacity=1.0 lengthPlusGirth=515 mm

20:57:05 7254049 RSSS results:

20:57:05 7254049 ----------------------------------------------------------

20:57:05 7254049 ('PRIORITY WORLDWIDE USA',2011-11-21,www.canadapost.ca,$ 72.82,false)

20:57:05 7254049 ('XPRESSPOST US',2011-11-21,2011-11-23,$ 28.97,false)

20:57:05 7254049 ('EXPEDITED US BUSINESS',2011-11-21,2011-11-28,$ 18.57,false)

20:57:05 7254049 ----------------------------------------------------------

20:57:05 7254049 Check if Merchant uses flat rates.

20:57:05 7254049 Building response for commerce engine ...

20:57:05 7254049 Adding : ('PRIORITY WORLDWIDE USA',2011-11-21,www.canadapost.ca,$ 72.82,false)

20:57:05 7254049 Adding : ('XPRESSPOST US',2011-11-21,2011-11-23,$ 28.97,false)

20:57:05 7254049 Adding : ('EXPEDITED US BUSINESS',2011-11-21,2011-11-28,$ 18.57,false)

20:57:05 7254049 Sending default/quick-packing values.

20:57:05 7254049 Sending the response to commerce engine...

20:57:05 7254049 Send Transmission Time=32 ms.

20:57:05 7254049 Request Completed - Status=0 - Total Time=31064 ms.

20:59:07 7254140 Incoming Request from (my IP address)

20:59:07 7254140 Request Size = 976 bytes & Receive Transmission Time=0 ms.

20:59:07 7254140 RATES AND SERVICES request.

20:59:07 7254140 Received: MerchantId = xxxxxxxxxxx

20:59:07 7254140 Received: itemsPrice = $ yyy.xx

20:59:07 7254140 Received : origin = V5T3C9

20:59:07 7254140 Replacing origin postal code 'V5T3C9' with 'V5T3C9'

20:59:07 7254140 Received : turnAroundTime = 24

20:59:07 7254140 Replacing turnAroundTime '24' with '24'

20:59:07 7254140 Received: itemsPrice = $ 100.0

20:59:07 7254140 Received: City = Vancouver

20:59:07 7254140 Received: Province = California

20:59:07 7254140 Received: Country = US

20:59:07 7254140 Received: dest PostalCode = xxxxx

20:59:07 7254140 Parsing items. Found '1' items

20:59:07 7254140 Parsing Item #1

20:59:07 7254140 Received: Quantity = 1

20:59:07 7254140 Received: Description = 2-3 Coin Relay

20:59:07 7254140 Received: Weight = 0.25 kg

20:59:07 7254140 Received: Length = 0 mm

20:59:07 7254140 Received: Width = 0 mm

20:59:07 7254140 Received: Height = 0 mm

20:59:07 7254140 Purolator supported 'false'

20:59:07 7254140 Find nearest outlet = false

20:59:07 7254140 ------------------

20:59:07 7254140 Packing constraint [PRIORITY WORLDWIDE CONSTRAINTS]

20:59:07 7254140 ------------------

20:59:07 7254140 Launching 'Classic Volumetric Engine'

20:59:07 7254140 Setting the VRMLFileName=xxxxxxxxxxxxxxxxxxxxxxxx

20:59:07 7254140 maxWeight=30.0 kg maxSize=2000x2000x2000 mm maxL+Girth=3000 mm

20:59:07 7254140 Filtering out larg box.

20:59:07 7254140 Box #1 : 'Office Depot #46014-0D 6x6x6' Size=(w,h,d)=152x152x152 mm Weight=0.105 kg Capacity=30.0 lengthPlusGirth=760 mm

20:59:07 7254140 Box #2 : 'Office Depot #46016-0D 12x9x5' Size=(w,h,d)=305x229x127 mm Weight=0.195 kg Capacity=30.0 lengthPlusGirth=1017 mm

20:59:07 7254140 Box #3 : 'Blue Kit Box' Size=(w,h,d)=195x100x60 mm Weight=0.1 kg Capacity=1.0 lengthPlusGirth=515 mm

20:59:07 7254140 Packing engine calculation Time=0 ms.

20:59:07 7254140 Generating the VRML output 'xxxxxxxxxxxxxxxxxxxxx'

20:59:07 7254140 Number of boxes = 1

20:59:07 7254140 Blue Kit Box TotalWeight=0.35

20:59:07 7254140 ------------------

20:59:07 7254140 Packing constraint [XPRESSPOST USA CONSTRAINTS]

20:59:07 7254140 ------------------

20:59:07 7254140 Launching 'Classic Volumetric Engine'

20:59:07 7254140 Setting the VRMLFileName=xxxxxxxxxxxxxxxxxxxxxxxx

20:59:07 7254140 maxWeight=30.0 kg maxSize=2000x2000x2000 mm maxL+Girth=2740 mm

20:59:07 7254140 Filtering out larg box.

20:59:07 7254140 Box #1 : 'Office Depot #46014-0D 6x6x6' Size=(w,h,d)=152x152x152 mm Weight=0.105 kg Capacity=30.0 lengthPlusGirth=760 mm

20:59:07 7254140 Box #2 : 'Office Depot #46016-0D 12x9x5' Size=(w,h,d)=305x229x127 mm Weight=0.195 kg Capacity=30.0 lengthPlusGirth=1017 mm

20:59:07 7254140 Box #3 : 'Blue Kit Box' Size=(w,h,d)=195x100x60 mm Weight=0.1 kg Capacity=1.0 lengthPlusGirth=515 mm

20:59:07 7254140 Packing engine calculation Time=1 ms.

20:59:07 7254140 Generating the VRML output 'xxxxxxxxxxxxxxxxxxxxxxxx'

20:59:07 7254140 Number of boxes = 1

20:59:07 7254140 Blue Kit Box TotalWeight=0.35

20:59:07 7254140 ------------------

20:59:07 7254140 Packing constraint [EXPEDITED USA CONSTRAINTS]

20:59:07 7254140 ------------------

20:59:07 7254140 Launching 'Classic Volumetric Engine'

20:59:07 7254140 Setting the VRMLFileName=xxxxxxxxxxxxxxxxxxxxxxxxx

20:59:07 7254140 maxWeight=30.0 kg maxSize=2000x2000x2000 mm maxL+Girth=2740 mm

20:59:07 7254140 Filtering out larg box.

20:59:07 7254140 Box #1 : 'Office Depot #46014-0D 6x6x6' Size=(w,h,d)=152x152x152 mm Weight=0.105 kg Capacity=30.0 lengthPlusGirth=760 mm

20:59:07 7254140 Box #2 : 'Office Depot #46016-0D 12x9x5' Size=(w,h,d)=305x229x127 mm Weight=0.195 kg Capacity=30.0 lengthPlusGirth=1017 mm

20:59:07 7254140 Box #3 : 'Blue Kit Box' Size=(w,h,d)=195x100x60 mm Weight=0.1 kg Capacity=1.0 lengthPlusGirth=515 mm

20:59:08 7254140 Packing engine calculation Time=1 ms.

20:59:08 7254140 Generating the VRML output 'xxxxxxxxxxxxxxxxxxxxxxxxxx'

20:59:08 7254140 Number of boxes = 1

20:59:08 7254140 Blue Kit Box TotalWeight=0.35

20:59:08 7254140 ------------------

20:59:08 7254140 Packing constraint [uS SMALL PACKETS CONSTRAINTS]

20:59:08 7254140 ------------------

20:59:08 7254140 Launching 'Classic Volumetric Engine'

20:59:08 7254140 Setting the VRMLFileName=xxxxxxxxxxxxxxxxxxxxxxxxxx

20:59:08 7254140 maxWeight=1.0 kg maxSize=600x600x600 mm maxL+Girth=900 mm

20:59:08 7254140 Filtering out larg box.

20:59:08 7254140 Box #1 : 'Office Depot #46014-0D 6x6x6' Size=(w,h,d)=152x152x152 mm Weight=0.105 kg Capacity=30.0 lengthPlusGirth=760 mm

20:59:08 7254140 Box #2 : 'Office Depot #46016-0D 12x9x5' Size=(w,h,d)=305x229x127 mm Weight=0.195 kg Capacity=30.0 lengthPlusGirth=1017 mm

20:59:08 7254140 Box #3 : 'Blue Kit Box' Size=(w,h,d)=195x100x60 mm Weight=0.1 kg Capacity=1.0 lengthPlusGirth=515 mm

20:59:08 7254140 Packing engine calculation Time=1 ms.

20:59:08 7254140 Generating the VRML output 'xxxxxxxxxxxxxxxxxx'

20:59:08 7254140 Number of boxes = 1

20:59:08 7254140 Blue Kit Box TotalWeight=0.35

20:59:08 7254140 No empty space calculation required for this merchant.

20:59:08 7254140 RSSS results:

20:59:08 7254140 ----------------------------------------------------------

20:59:08 7254140 ('PRIORITY WORLDWIDE USA',2011-11-21,www.canadapost.ca,$ 69.32,false)

20:59:08 7254140 ('XPRESSPOST US',2011-11-21,2011-11-23,$ 27.47,false)

20:59:08 7254140 ('EXPEDITED US BUSINESS',2011-11-21,2011-11-28,$ 17.07,false)

20:59:08 7254140 ('SMALLPACKET AIR US',2011-11-21,up to 2 weeks,$ 9.90,false)

20:59:08 7254140 ('SMALLPACKET SURFACE US',2011-11-21,2 to 4 weeks,$ 8.35,false)

20:59:08 7254140 ----------------------------------------------------------

20:59:08 7254140 Check if Merchant uses flat rates.

20:59:08 7254140 Building response for commerce engine ...

20:59:08 7254140 Adding : ('PRIORITY WORLDWIDE USA',2011-11-21,www.canadapost.ca,$ 69.32,false)

20:59:08 7254140 Adding : ('XPRESSPOST US',2011-11-21,2011-11-23,$ 27.47,false)

20:59:08 7254140 Adding : ('EXPEDITED US BUSINESS',2011-11-21,2011-11-28,$ 17.07,false)

20:59:08 7254140 Adding : ('SMALLPACKET AIR US',2011-11-21,up to 2 weeks,$ 9.90,false)

20:59:08 7254140 Adding : ('SMALLPACKET SURFACE US',2011-11-21,2 to 4 weeks,$ 8.35,false)

20:59:08 7254140 Generating XML...

20:59:08 7254140 Sending the response to commerce engine...

20:59:08 7254140 Send Transmission Time=41 ms.

20:59:08 7254140 Request Completed - Status=0 - Total Time=952 ms.

-----------------------------(end CP log Quote)-----------------------------------------

 

I'll see if I can get any more of these...

Link to comment
Share on other sites

To continue, this is what Canada Post is looking for and, about 1/2way down is the response (look for " <ratesAndServicesResponse>")

 

Note the '<packing>' relates to the box choosing (as far as I can figure out)

 

----------------(quote)-----------------------

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE eparcel [

<!-- EVERY REQUEST CONTAIN THE eparcel TAG -->

<!ELEMENT eparcel (ratesAndServicesResponse)>

<!-- ********************************************************* -->

<!-- * Standard response for request for rates and services * -->

<!-- ********************************************************* -->

<!ELEMENT ratesAndServicesResponse (statusCode, statusMessage+, requestID, handling, language, product+, packing*, emptySpace*, shippingOptions, comment, nearestPostalOutlet*)>

<!ELEMENT statusCode (#PCDATA)>

<!ELEMENT statusMessage (#PCDATA)>

<!ELEMENT requestID (#PCDATA)>

<!ELEMENT handling (#PCDATA)>

<!ELEMENT language (#PCDATA)>

<!ELEMENT product (name, rate, shippingDate, deliveryDate, deliveryDayOfWeek, nextDayAM?, packingID)>

<!ATTLIST product

id CDATA #REQUIRED

sequence CDATA #REQUIRED

>

<!ELEMENT name (#PCDATA)>

<!ELEMENT rate (#PCDATA)>

<!ELEMENT shippingDate (#PCDATA)>

<!ELEMENT deliveryDate (#PCDATA)>

<!ELEMENT deliveryDayOfWeek (#PCDATA)>

<!ELEMENT nextDayAM (#PCDATA)>

<!ELEMENT packingID (#PCDATA)>

<!ELEMENT packing (packingID, box+)>

<!ELEMENT box (name, weight, expediterWeight, length, width, height, packedItem+)>

<!ELEMENT weight (#PCDATA)>

<!ELEMENT expediterWeight (#PCDATA)>

<!ELEMENT length (#PCDATA)>

<!ELEMENT width (#PCDATA)>

<!ELEMENT height (#PCDATA)>

<!ELEMENT packedItem (quantity, description)>

<!ELEMENT quantity (#PCDATA)>

<!ELEMENT description (#PCDATA)>

<!ELEMENT emptySpace (length, width, height, weight)>

<!ELEMENT shippingOptions (insurance, deliveryConfirmation, signature, flexiblePaymentAvailable?)>

<!ELEMENT insurance (#PCDATA)>

<!ELEMENT deliveryConfirmation (#PCDATA)>

<!ELEMENT signature (#PCDATA)>

<!ELEMENT flexiblePaymentAvailable EMPTY>

<!ELEMENT comment (#PCDATA)>

<!-- ********************************************************* -->

<!-- * 'nearestPostalOutlet' is optional and is returned * -->

<!-- * only if the merchant profile has this option enabled * -->

<!-- ********************************************************* -->

<!ELEMENT nearestPostalOutlet (postalOutletSequenceNo, distance, outletName, businessName, postalAddress, phoneNumber, businessHours+)>

<!ELEMENT postalOutletSequenceNo (#PCDATA)>

<!ELEMENT distance (#PCDATA)>

<!ELEMENT outletName (#PCDATA)>

<!ELEMENT businessName (#PCDATA)>

<!ELEMENT postalAddress (addressLine+, postalCode, municipality, province?)>

<!ELEMENT addressLine (#PCDATA)>

<!ELEMENT postalCode (#PCDATA)>

<!ELEMENT municipality (#PCDATA)>

<!ELEMENT province (#PCDATA)>

<!ELEMENT phoneNumber (#PCDATA)>

<!ELEMENT businessHours (dayId, dayOfWeek, time)>

<!ELEMENT dayId (#PCDATA)>

<!ELEMENT dayOfWeek (#PCDATA)>

<!ELEMENT time (#PCDATA)>

 

]>

<eparcel>

<ratesAndServicesResponse>

 

<statusCode>1</statusCode>

<statusMessage>OK</statusMessage>

<requestID>(just some number CP makes up)</requestID>

<handling>0.0</handling>

<language>0</language>

<product id="1040" sequence="1">

<name>Priority Courier</name>

<rate>42.8</rate>

<shippingDate>2011-11-21</shippingDate>

<deliveryDate>2011-11-22</deliveryDate>

<deliveryDayOfWeek>3</deliveryDayOfWeek>

<nextDayAM>true</nextDayAM>

<packingID>P_0</packingID>

</product>

<product id="1020" sequence="2">

<name>Expedited</name>

<rate>18.36</rate>

<shippingDate>2011-11-21</shippingDate>

<deliveryDate>2011-11-22</deliveryDate>

<deliveryDayOfWeek>3</deliveryDayOfWeek>

<nextDayAM>false</nextDayAM>

<packingID>P_0</packingID>

</product>

<product id="1010" sequence="3">

<name>Regular</name>

<rate>18.36</rate>

<shippingDate>2011-11-21</shippingDate>

<deliveryDate>2011-11-24</deliveryDate>

<deliveryDayOfWeek>5</deliveryDayOfWeek>

<nextDayAM>false</nextDayAM>

<packingID>P_0</packingID>

</product>

 

 

<packing>

<packingID>P_0</packingID>

<box>

<name>Small Box</name>

<weight>1.691</weight>

<expediterWeight>1.691</expediterWeight>

<length>25.0</length>

<width>17.0</width>

<height>16.0</height>

<packedItem>

<quantity>1</quantity>

<description>KAO Diskettes</description>

</packedItem>

 

 

</box>

<box>

<name>My Ready To Ship Item</name>

<weight>2.0</weight>

<expediterWeight>1.5</expediterWeight>

<length>30.0</length>

<width>20.0</width>

<height>20.0</height>

<packedItem>

<quantity>1</quantity>

<description>My Ready To Ship Item</description>

</packedItem>

 

 

</box>

 

</packing>

 

<shippingOptions>

<insurance>No</insurance>

<deliveryConfirmation>Yes</deliveryConfirmation>

<signature>No</signature>

 

</shippingOptions>

 

<comment/>

 

 

</ratesAndServicesResponse>

</eparcel>

<!--END_OF_EPARCEL-->

------------------(end quote)-------------------------

Edited by Pinball
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...