Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

New UPS XML Shipping Module available


Recommended Posts

Hello,

 

I have been troubleshooting this issue with UPS Online Tools UK and have had the following response:

 

Hi Alec

 

The address you have in the Source Code is https://wwwcie.ups.com:443/ups.app/xml/TimeInTransit

 

The correct address should be as below: See attached tech document.

 

Connection Address

Time in Transit request documents must be sent to the UPS OnLine Tools server for processing. Each

request requires specific processing based on the request type; therefore, each tool has a unique URL for

connection purposes. The URL for connecting to UPS Time in Transit is:

https://www.ups.com/ups.app/xml/TimeInTransit.

 

For integration testing, you should direct your test Time In Transit software to:

https://wwwcie.ups.com/ups.app/xml/TimeInTransit.

 

I do not understand why this is happening as my ups configuration is set to production mode

 

However the UPS tech guys suggest im using the test server. Does this need fixing and if so how can i fix it?

 

Thanks for your help.

Link to comment
Share on other sites

some small tweaks id like to do....anybody know where to do it?

 

remove weights from all the UPS sections(ex: '(1 pkg x 9.68 lbs total)').

 

remove the ',' from after all the shipping options(ex: 'UPS Ground, ')

 

Thanks

Link to comment
Share on other sites

No comments on the feedback i got from ups about the url is use being a test server? Is no one else having the same problems as me with incorrect values and not all the options being displayed?

Link to comment
Share on other sites

I'm getting an error and i can't find the problem:

 

the debug code is:

DATE AND TIME: 2005-12-08 15:59:52
UPS URL: https://wwwcie.ups.com:443/ups.app/xml/Rate
UPS REQUEST: <?xml version="1.0"?>
<AccessRequest xml:lang="en-US">
  <AccessLicenseNumber>xxxxxxxxx</AccessLicenseNumber>
  <UserId>xxxxx</UserId>
  <Password>xxxxxx</Password>
</AccessRequest>
<?xml version="1.0"?>
<RatingServiceSelectionRequest xml:lang="en-US">
  <Request>
   <TransactionReference>
	   <CustomerContext>Rating and Service</CustomerContext>
	   <XpciVersion>1.0001</XpciVersion>
   </TransactionReference>
   <RequestAction>Rate</RequestAction>
   <RequestOption>shop</RequestOption>
  </Request>
  <PickupType>
   <Code>01</Code>
  </PickupType>
  <Shipment>
   <Shipper>
	   <Address>
		   <City>Amsterdam</City>
		   <StateProvinceCode>NH</StateProvinceCode>
		   <CountryCode>NL</CountryCode>
		   <PostalCode>1031HL</PostalCode>
	   </Address>
   </Shipper>
   <ShipTo>
	   <Address>
		   <City>Tucson</City>
		   <StateProvinceCode></StateProvinceCode>
		   <CountryCode>US</CountryCode>
		   <PostalCode>85718</PostalCode>
	   </Address>
   </ShipTo>
  </Shipment>
  <CustomerClassification>
   <Code>03</Code>
  </CustomerClassification>
</RatingServiceSelectionRequest>

UPS RESPONSE:
<?xml version="1.0"?>
 <RatingServiceSelectionResponse> 
 <Response>
	 <TransactionReference>
		 <CustomerContext>Rating and Service</CustomerContext> 
		 <XpciVersion>1.0001</XpciVersion>
	 </TransactionReference>
	 <ResponseStatusCode>0</ResponseStatusCode>
	 <ResponseStatusDescription>Failure</ResponseStatusDescription>
	 <Error>
		 <ErrorSeverity>Hard</ErrorSeverity>
		 <ErrorCode>10002</ErrorCode>
		 <ErrorDescription>
			The XML document is well formed but the document is not valid
		 </ErrorDescription>
		 <ErrorLocation>
			<ErrorLocationElementName>
				  RatingServiceSelectionRequest/Shipment/Package
			</ErrorLocationElementName>
		  </ErrorLocation>
	   </Error>
   </Response>
  </RatingServiceSelectionResponse>

 

What is wrong?

Edited by RikP
Link to comment
Share on other sites

I'm getting an error and i can't find the problem:

			   <StateProvinceCode></StateProvinceCode>
		   <CountryCode>US</CountryCode>
		   <PostalCode>85718</PostalCode>

The state is missing (presumably Arizona: AZ), that might trigger it.

 

Also see this post regarding an error about incorrect pickup type.

   <CustomerClassification>
   <Code>03</Code>
  </CustomerClassification>
</RatingServiceSelectionRequest>

Link to comment
Share on other sites

Alec,

I have been troubleshooting this issue with UPS Online Tools UK and have had the following response:

I do not understand why this is happening as my ups configuration is set to production mode

 

However the UPS tech guys suggest im using the test server. Does this need fixing and if so how can i fix it?

Now that you mention it: in line 56 op includes/modules/shipping/upsxml.php it says:

		$this->host = ((MODULE_SHIPPING_UPSXML_RATES_TEST_MODE == 'Test') ? 'wwwcie.ups.com' : 'wwwcie.ups.com');

This makes more sense:

		$this->host = ((MODULE_SHIPPING_UPSXML_RATES_TEST_MODE == 'Test') ? 'wwwcie.ups.com' : 'www.ups.com');

Link to comment
Share on other sites

EDIT: actually, just need to turn off the "date expected" part of the display

Check the source code of includes/modules/shipping/upsxml.php and find this part (around line 226) and comment it out like this:

// BOF Time In Transit: comment out this section if you don't want/need to have
// expected delivery dates
/* start commenting out
	$this->servicesTimeintransit = $this->_upsGetTimeServices();
	if ($this->logfile) {
		error_log("------------------------------------------\n", 3, $this->logfile);
		error_log("Time in Transit: " . $this->timeintransit . "\n", 3, $this->logfile);
	}
end of commenting out: */
// EOF Time In Transit

Link to comment
Share on other sites

			   <StateProvinceCode></StateProvinceCode>
		   <CountryCode>US</CountryCode>
		   <PostalCode>85718</PostalCode>

The state is missing (presumably Arizona: AZ), that might trigger it.

 

Also see this post regarding an error about incorrect pickup type.

   <CustomerClassification>
   <Code>03</Code>
  </CustomerClassification>
</RatingServiceSelectionRequest>

 

Thanks for the quick answer!

I have added the statecode and removed the pickup and customerclassification. But i'm still getting the same error. Also i noticed there are no products in the xml file. I have selected UPS pak and there should be at least 1 product in there ;-)

 

beneath the new xml file

DATE AND TIME: 2005-12-09 09:53:45
UPS URL: https://wwwcie.ups.com:443/ups.app/xml/Rate
UPS REQUEST: <?xml version="1.0"?>
<AccessRequest xml:lang="en-US">
  <AccessLicenseNumber>xxxxxx</AccessLicenseNumber>
  <UserId>rxxxxx</UserId>
  <Password>xxxxx</Password>
</AccessRequest>
<?xml version="1.0"?>
<RatingServiceSelectionRequest xml:lang="en-US">
  <Request>
   <TransactionReference>
	   <CustomerContext>Rating and Service</CustomerContext>
	   <XpciVersion>1.0001</XpciVersion>
   </TransactionReference>
   <RequestAction>Rate</RequestAction>
   <RequestOption>shop</RequestOption>
  </Request>
  <Shipment>
   <Shipper>
	   <Address>
		   <City>Heerenveen</City>
		   <StateProvinceCode>DR</StateProvinceCode>
		   <CountryCode>NL</CountryCode>
		   <PostalCode>8448EX</PostalCode>
	   </Address>
   </Shipper>
   <ShipTo>
	   <Address>
		   <City>Tucson</City>
		   <StateProvinceCode>AZ</StateProvinceCode>
		   <CountryCode>US</CountryCode>
		   <PostalCode>85718</PostalCode>
	   </Address>
   </ShipTo>
  </Shipment>
</RatingServiceSelectionRequest>

UPS RESPONSE: <?xml version="1.0"?><RatingServiceSelectionResponse><Response><TransactionReference><CustomerContext>Rating and Service</CustomerContext><XpciVersion>1.0001</XpciVersion></TransactionReference><ResponseStatusCode>0</ResponseStatusCode><ResponseStatusDescription>Failure</ResponseStatusDescription><Error><ErrorSeverity>Hard</ErrorSeverity><ErrorCode>10002</ErrorCode><ErrorDescription>The XML document is well formed but the document is not valid</ErrorDescription><ErrorLocation><ErrorLocationElementName>RatingServiceSelectionRequest/Shipment/Package</ErrorLocationElementName></ErrorLocation></Error></Response></RatingServiceSelectionResponse>

Edited by RikP
Link to comment
Share on other sites

I have added the statecode and removed the pickup and customerclassification. But i'm still getting the same error. Also i noticed there are no products in the xml file. I have selected UPS pak and there should be at least 1 product in there

Yes, you are right. The response says it really:

<ErrorLocation>
<ErrorLocationElementName>RatingServiceSelectionRequest/Shipment/Package
</ErrorLocationElementName>
</ErrorLocation>

What is missing from the request (after the </Shipto> tag is this part:

	   <Package>
	   <PackagingType>
		   <Code>02</Code>
	   </PackagingType>
	   <PackageWeight>
		   <UnitOfMeasurement>
			   <Code>KGS</Code>
		   </UnitOfMeasurement>
		   <Weight>1.1</Weight>
	   </PackageWeight>
   </Package>

I don't know how that got lost...

Link to comment
Share on other sites

Hi Janz, thanks for the update, i have tried that already with no difference
No difference in what? You know what UPS sends you through logging. UPS XML cannot give you more than UPS quotes for. The rates UPS quotes are different between the standard osC one (higher) and the UPS XML and different than what they quote through Worldship (PC software used in the States).
Link to comment
Share on other sites

this is ridiculous! why on earth is this happening?? i just uploaded a fresh version of oscommerce, so no other contribs or anything has been done to it, tried installing this module and the EXACT same thing is happening!

 

before i upload catalog/includes/modules/shipping/upsxml.php, everything looks right in the Admin->Modules->Shipping area (table with 4 columns, all current shipping options are there).

 

as soon as i upload that file, the Admin->Modules->Shipping area gets all messed up (table with only 3 columns - the Install/Remove/Edit column is gone, and so are the USPS and Zone Rates shipping options, PLUS the UPS XML option isn't even there!)

 

i can't believe i'm the only person that has this problem... again, it's a fresh install of oscommerce and this is the first contrib i'm trying to put in it.

 

can anyone help, please?! i have a client who is (getting impatiently) waiting for me to install this for him.

Link to comment
Share on other sites

this is ridiculous! why on earth is this happening?? i just uploaded a fresh version of oscommerce, so no other contribs or anything has been done to it, tried installing this module and the EXACT same thing is happening!
What I miss in your description is that you did STEP 5 mentioned in the readme.txt. If you don't enlarge the database field for set_function you will get a parse error:

1) Go to the configuration table in your database and change the type for
  field "set_function" from VARCHAR(255) to TEXT

If you haven't done any of the above mentioned two things while installing, you will get an error message in the admin section:
 "Parse error: parse error, unexpected ';' in ....../admin/modules.php(235): eval()'d code on line 1"
To rectify that, do any of the two options above, go to the admin section, shipping and "remove" upsxml, then "install" upsxml (again).

If the server you are installing on is set to not echo error messages (a lot of servers do that, for good reason) you might just see part of the page till when the error occurs.

 

This makes debugging so difficult. That is why it makes good sense to do your development work locally when you do can seen all the error and warning messages of PHP.

Link to comment
Share on other sites

Yes, you are right. The response says it really:

<ErrorLocation>
<ErrorLocationElementName>RatingServiceSelectionRequest/Shipment/Package
</ErrorLocationElementName>
</ErrorLocation>

What is missing from the request (after the </Shipto> tag is this part:

	   <Package>
	   <PackagingType>
		   <Code>02</Code>
	   </PackagingType>
	   <PackageWeight>
		   <UnitOfMeasurement>
			   <Code>KGS</Code>
		   </UnitOfMeasurement>
		   <Weight>1.1</Weight>
	   </PackageWeight>
   </Package>

I don't know how that got lost...

 

Janz one thing that i noticed was that i needed to install the .sql file (for dimensions) but i don't use that module (only weight, UPS Pak). But when i didn't install the sql file it came with an error that it couldn't find the TABLES_PACKAGES sql query??

Link to comment
Share on other sites

What I miss in your description is that you did STEP 5 mentioned in the readme.txt. If you don't enlarge the database field for set_function you will get a parse error:

1) Go to the configuration table in your database and change the type for
  field "set_function" from VARCHAR(255) to TEXT

If you haven't done any of the above mentioned two things while installing, you will get an error message in the admin section:
 "Parse error: parse error, unexpected ';' in ....../admin/modules.php(235): eval()'d code on line 1"
To rectify that, do any of the two options above, go to the admin section, shipping and "remove" upsxml, then "install" upsxml (again).

If the server you are installing on is set to not echo error messages (a lot of servers do that, for good reason) you might just see part of the page till when the error occurs.

 

This makes debugging so difficult. That is why it makes good sense to do your development work locally when you do can seen all the error and warning messages of PHP.

 

I did Step 5 as well. I just went and checked the database - that field is set to text, but maybe some other values are wrong?? This is how it looks:

Field: set_function

Type: text

Attributes:

Null: Yes

Default: NULL

 

Do I need to change any of those values? Also, should i turn on error messages while i'm doing this, so i can see the errors and warning messages? Hehe, i'd rather see big bold red errors than pages that are half missing! How do i do this? I think i said before, i'm a real newbie at a lot of this stuff. Thanks so much for your help.

 

~Justin

Link to comment
Share on other sites

I did Step 5 as well. I just went and checked the database - that field is set to text, but maybe some other values are wrong??
That looks fine.
Also, should i turn on error messages while i'm doing this, so i can see the errors and warning messages?
That is something the server admin can do, probably he/she won't be eager to change that. However, in the PHP ini file you can define a log file, so that PHP errors are at least logged. Ask them about that.

 

Also take a look at the source code of the page in admin. It might give a clue on what point of the page/code the error occurs (which I think happens).

 

One more thing, in catalog/includes/modules/shipping/upsxml.php there is one line you need to change. Change define('DIMENSIONS_SUPPORTED', 1); to 0, like this:

define('DIMENSIONS_SUPPORTED', 0);

It doesn't affect the admin part though.

Link to comment
Share on other sites

That looks fine.

That is something the server admin can do, probably he/she won't be eager to change that. However, in the PHP ini file you can define a log file, so that PHP errors are at least logged. Ask them about that.

i have access to the php ini file, do i just set log_errors = On, and say error_log = errors.log?

 

Also take a look at the source code of the page in admin. It might give a clue on what point of the page/code the error occurs (which I think happens).

In the source code, it shows the table being made for all the options, only with 3 columns - Modules, Sort Order, and Action; then the code abbruptly ends after the row for United Parcel Service ... after the closing </tr> tag there is nothing else.

 

One more thing, in catalog/includes/modules/shipping/upsxml.php there is one line you need to change. Change define('DIMENSIONS_SUPPORTED', 1); to 0, like this:

define('DIMENSIONS_SUPPORTED', 0);

It doesn't affect the admin part though.

I did set DIMENSIONS_SUPPORTED to 0 already... i think i remember reading that somewhere in the last 39 pages or so ;)

Link to comment
Share on other sites

Hi Janz,

 

When i said "i tried that" i was referring that i chnaged the url you mentioned in your thread to the correct non test url. Does this make sense

 

Cheers

Link to comment
Share on other sites

i have access to the php ini file, do i just set log_errors = On, and say error_log = errors.log?
Sounds OK, I can't find the file on my Mac so I can check. Perhaps you have to set a path for the errors.log too. Somewhere in that area it should also be able to toggle display_errors?
In the source code, it shows the table being made for all the options, only with 3 columns - Modules, Sort Order, and Action; then the code abbruptly ends after the row for United Parcel Service ... after the closing </tr> tag there is nothing else.
That could be that field being to short and giving an error. Since for every module (that closes with a </tr> tag) it does:

		for ($j=0, $k=sizeof($module_keys); $j<$k; $j++) {
	  $key_value_query = tep_db_query("select configuration_title, configuration_value, configuration_description, use_function, set_function from " . TABLE_CONFIGURATION . " where configuration_key = '" . $module_keys[$j] . "'");
	  $key_value = tep_db_fetch_array($key_value_query);

Make sure (with phpMyAdmin) that you shorten the last field in the row with Shipping Methods, MODULE_SHIPPING_UPSXML_TYPES etc. to something that has , 'A UPS Method'), at the end. Then if that was the problem, uninstall and install.

Link to comment
Share on other sites

Make sure (with phpMyAdmin) that you shorten the last field in the row with Shipping Methods, MODULE_SHIPPING_UPSXML_TYPES etc. to something that has , 'A UPS Method'), at the end.

could you explain that one a little bit to me... i'm not really sure what you mean. :blush:

Link to comment
Share on other sites

Alec,

When i said "i tried that" i was referring that i chnaged the url you mentioned in your thread to the correct non test url. Does this make sense

I'm glad to learn that everybody who due to this bug used the test server for his site apparently didn't suffer any problems. However, I still don't know what your problem is.

Link to comment
Share on other sites

Janz one thing that i noticed was that i needed to install the .sql file (for dimensions) but i don't use that module (only weight, UPS Pak). But when i didn't install the sql file it came with an error that it couldn't find the TABLES_PACKAGES sql query??
I think that is because of the DIMENSIONS_SUPPORTED = 1 (see a few posts back). It should have been 0 in the contrib, one of the contributors changed it by mistake. Quite a few people ran into that.
Link to comment
Share on other sites

One more thing, in catalog/includes/modules/shipping/upsxml.php there is one line you need to change. Change define('DIMENSIONS_SUPPORTED', 1); to 0, like this:

define('DIMENSIONS_SUPPORTED', 0);

It doesn't affect the admin part though.

 

Hi Janz,

 

Thanks this way i don't get errors anymore.

But there is nothing at the checkout page for ups (see screenshot).

 

upsxml.jpg

 

The xml is as follows:

 

DATE AND TIME: 2005-12-10 15:08:57

UPS URL: https://wwwcie.ups.com:443/ups.app/xml/Rate

UPS REQUEST: <?xml version="1.0"?>

<AccessRequest xml:lang="en-US">

<AccessLicenseNumber>xxxxxxxxxxxxxxx</AccessLicenseNumber>

<UserId>xxxxxxxxxxxx</UserId>

<Password>xxxxxxxxxxxx</Password>

</AccessRequest>

<?xml version="1.0"?>

<RatingServiceSelectionRequest xml:lang="en-US">

<Request>

<TransactionReference>

<CustomerContext>Rating and Service</CustomerContext>

<XpciVersion>1.0001</XpciVersion>

</TransactionReference>

<RequestAction>Rate</RequestAction>

<RequestOption>shop</RequestOption>

</Request>

<Shipment>

<Shipper>

<Address>

<City>Heerenveen</City>

<StateProvinceCode>DR</StateProvinceCode>

<CountryCode>NL</CountryCode>

<PostalCode>8448EX</PostalCode>

</Address>

</Shipper>

<ShipTo>

<Address>

<City>Tucson</City>

<StateProvinceCode>AZ</StateProvinceCode>

<CountryCode>US</CountryCode>

<PostalCode>85718</PostalCode>

</Address>

</ShipTo>

<Package>

<PackagingType>

<Code>04</Code>

</PackagingType>

<PackageWeight>

<UnitOfMeasurement>

<Code>KGS</Code>

</UnitOfMeasurement>

<Weight>2.5</Weight>

</PackageWeight>

<PackageServiceOptions>

<InsuredValue>

<CurrencyCode>EUR</CurrencyCode>

<MonetaryValue>145</MonetaryValue>

</InsuredValue>

</PackageServiceOptions>

</Package>

</Shipment>

</RatingServiceSelectionRequest>

 

UPS RESPONSE: <?xml version="1.0"?><RatingServiceSelectionResponse><Response><TransactionReference><CustomerContext>Rating and Service</CustomerContext><XpciVersion>1.0001</XpciVersion></TransactionReference><ResponseStatusCode>1</ResponseStatusCode><ResponseStatusDescription>Success</ResponseStatusDescription></Response><RatedShipment><Service><Code>07</Code></Service><BillingWeight><UnitOfMeasurement><Code>KGS</Code></UnitOfMeasurement><Weight>2.5</Weight></BillingWeight><TransportationCharges><CurrencyCode>EUR</CurrencyCode><MonetaryValue>101.92</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>EUR</CurrencyCode><MonetaryValue>1.45</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>EUR</CurrencyCode><MonetaryValue>103.37</MonetaryValue></TotalCharges><GuaranteedDaysToDelivery></GuaranteedDaysToDelivery><ScheduledDeliveryTime></ScheduledDeliveryTime><RatedPackage><TransportationCharges><CurrencyCode> </CurrencyCode><MonetaryValue> </MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode> </CurrencyCode><MonetaryValue> </MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode> </CurrencyCode><MonetaryValue> </MonetaryValue></TotalCharges><Weight>2.5</Weight><BillingWeight><UnitOfMeasurement><Code> </Code></UnitOfMeasurement><Weight> </Weight></BillingWeight></RatedPackage></RatedShipment>

<RatedShipment><Service><Code>54</Code></Service><BillingWeight><UnitOfMeasurement><Code>KGS</Code></UnitOfMeasurement><Weight>2.5</Weight></BillingWeight><TransportationCharges><CurrencyCode>EUR</CurrencyCode><MonetaryValue>142.58</MonetaryValue></TransportationCharges>

<ServiceOptionsCharges><CurrencyCode>EUR</CurrencyCode><MonetaryValue>1.45</MonetaryValue></ServiceOptionsCharges>

<TotalCharges><CurrencyCode>EUR</CurrencyCode><MonetaryValue>144.03</MonetaryValue></TotalCharges><GuaranteedDaysToDelivery></GuaranteedDaysToDelivery><ScheduledDeliveryTime></ScheduledDeliveryTime><RatedPackage><TransportationCharges><CurrencyCode> </CurrencyCode><MonetaryValue> </MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode> </CurrencyCode><MonetaryValue> </MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode> </CurrencyCode><MonetaryValue> </MonetaryValue></TotalCharges><Weight>2.5</Weight>

<BillingWeight><UnitOfMeasurement><Code> </Code></UnitOfMeasurement><Weight> </Weight></BillingWeight></RatedPackage></RatedShipment></RatingServiceSelectionResponse>

 

Any idea what the problem can be?

Edited by RikP
Link to comment
Share on other sites

But there is nothing at the checkout page for ups (see screenshot).
Strange because they quoted you for two services:

<Service><Code>07</Code>
<Service><Code>54</Code>

Which would correspond with:

	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_07', 'UPS Worldwide Express');
define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_54', 'UPS Worldwide Express Plus');

This would happen if you excluded those in the admin section. Otherwise I don't have an explanation.

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...