19 replies [Last post]
akira's picture
Offline
Joined: 01/28/2008
Juice: 46
Was this information Helpful?

is it possible to use the same UPS account on the other ubercart project?

I have first ubercart project, and it was sucesfull to get UPS quote rate(trial peoject)

But i just have the second project from client to build e-commerce, and i just use my UPS account to test if the UPS module setup correctly. But It failled to report the Quote.

When i turn on debug information, it report:

<?xml version="1.0" encoding="UTF-8"?>
<AccessRequest xml:lang="en-US">
  <AccessLicenseNumber>EC1E24497B057ECC</AccessLicenseNumber>
  <UserId>rsugihar</UserId>
  <Password>******</Password>
</AccessRequest>

<?xml version="1.0" encoding="UTF-8"?>
<RatingServiceSelectionRequest xml:lang="en-US">
  <Request>
    <TransactionReference>
      <CustomerContext>Complex Rate Request</CustomerContext>
      <XpciVersion>1.0001</XpciVersion>
    </TransactionReference>
    <RequestAction>Rate</RequestAction>
    <RequestOption>rate</RequestOption>
  </Request>
  <PickupType>
    <Code>01</Code>
  </PickupType>
  <CustomerClassification>
    <Code>01</Code>
  </CustomerClassification>
  <Shipment>
    <Shipper>
      <ShipperNumber>6WY241</ShipperNumber>
      <Address>
        <City>culver</City>
        <StateProvinceCode>CA</StateProvinceCode>
        <PostalCode>90064</PostalCode>
        <CountryCode>US</CountryCode>
      </Address>
    </Shipper>
    <ShipTo>
      <Address>
        <StateProvinceCode>CA</StateProvinceCode>
        <PostalCode>92803</PostalCode>
        <CountryCode>US</CountryCode>
      </Address>
    </ShipTo>
    <ShipFrom>
      <Address>
        <StateProvinceCode>CA</StateProvinceCode>
        <PostalCode>92064</PostalCode>
        <CountryCode>US</CountryCode>
      </Address>
    </ShipFrom>
    <ShipmentWeight>
      <UnitOfMeasurement>
        <Code>LBS</Code>
      </UnitOfMeasurement>
      <Weight>1.0</Weight>
    </ShipmentWeight>
    <Service>
      <Code>12</Code>
      <Description>UPS 3-Day Select</Description>
    </Service>
    <Package><PackagingType><Code>02</Code></PackagingType><Dimensions><UnitOfMeasurement><Code>IN</Code></UnitOfMeasurement><Length>1.00</Length><Width>1.00</Width><Height>2.00</Height></Dimensions><PackageWeight><UnitOfMeasurement><Code>LBS</Code><Description>Pounds</Description></UnitOfMeasurement><Weight>1.0</Weight></PackageWeight><PackageServiceOptions><InsuredValue><CurrencyCode>USD</CurrencyCode><MonetaryValue>22.5</MonetaryValue></InsuredValue></PackageServiceOptions></Package></Shipment>
</RatingServiceSelectionRequest>

Although first peoject and second project has different items , i have same setup for UPS account.
I admit that the first installation (2nd project) was with Ubercart beta 5, but i just override it with beta 6 2 days ago.
Is it the reason ? Or i need to do something like 'update.php' after override it with beta 6 ?
I've been trying to solve this issue for 2 days, but have no good result.

Any suggestion would be appreciated.

-akira

akira's picture
Offline
Joined: 01/28/2008
Juice: 46
Re: UPS failed to show Quote (only xml)

Do you think that i've setup correctly for UPS account ? Since i don;t see any 'error' words in the XML.

Anyone who has the same experience ?
I did uninstall shipping module, and re-install them again, but no luck.

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Re: UPS failed to show Quote (only xml)

All that XML is just what you're sending to UPS. I don't see any response from them. I would think that a lack of response would cause a PHP error or something. It's really weird that all you get is your request.

Take a look through Watchdog, PHP error log, and the Javascript console with Firebug. Surely one of those will have clues.

akira's picture
Offline
Joined: 01/28/2008
Juice: 46
Hi lyle, you've got PM.

Hi lyle,

you've got PM.

akira's picture
Offline
Joined: 01/28/2008
Juice: 46
Re: Hi lyle,

It must be something wrong with the hosting setup.

Because when i setup the Drupal+ubercart into a new domain name with different
hosting, everything works well.

Anyone has the same problem ??

Please help me....i need to turn this project today.
But still has problem with UPS shipping.

Here is the comparison (same code)
http://dirtyredgear.com/shop/

and

http://vistadigitaltech.info/

NB: the hosting with UPS Error(can;t send data to UPS) is under 'reseller hosting'.
Configuration:
Php 5.2.5
Apache/1.3.39 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_ssl/2.8.30 OpenSSL/0.9.7a

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Re: Hi lyle,

Maybe the cache tables are out of date, particularly cache_workflow_ng. I've seen that cause some very strange things. I hope that's it because I don't see what else can be wrong. Checking mod_ssl was going to be my next suggestion. Sad

At this point it might be time to put some debug lines in the code itself. I'd start at the beginning of uc_ups_quote() to see if it's actually being called ever. Use drupal_set_message() so it won't mess up the normal functioning, though you'll have to refresh the cart page to see the messages.

akira's picture
Offline
Joined: 01/28/2008
Juice: 46
Re: Re: Re: Hi lyle,

I tried to goto uc_ups.module. And in the uc_ups_quote() function,i put "drupal_set_message('

'. print_r($quotes, true) .'

');" right before return $quotes;

I'm not sure if i do the right thing to do what Lyle suggested.

And here is the result:

Array
(
    [12] => Array
        (
            [debug] => <?xml version="1.0" encoding="UTF-8"?>
<AccessRequest xml:lang="en-US">
  <AccessLicenseNumber>EC1E24497B057ECC</AccessLicenseNumber>
  <UserId>rsugihar</UserId>
  <Password>*****</Password>
</AccessRequest>

<?xml version="1.0" encoding="UTF-8"?>
<RatingServiceSelectionRequest xml:lang="en-US">
  <Request>
    <TransactionReference>
      <CustomerContext>Complex Rate Request</CustomerContext>
      <XpciVersion>1.0001</XpciVersion>
    </TransactionReference>
    <RequestAction>Rate</RequestAction>
    <RequestOption>rate</RequestOption>
  </Request>
  <PickupType>
    <Code>01</Code>
  </PickupType>
  <CustomerClassification>
    <Code>01</Code>
  </CustomerClassification>
  <Shipment>
    <Shipper>
      <ShipperNumber>6WY241</ShipperNumber>
      <Address>
        <City>Poway</City>
        <StateProvinceCode>CA</StateProvinceCode>
        <PostalCode>92064</PostalCode>
        <CountryCode>US</CountryCode>
      </Address>
    </Shipper>
    <ShipTo>
      <Address>
        <StateProvinceCode>CA</StateProvinceCode>
        <PostalCode>9</PostalCode>
        <CountryCode>US</CountryCode>
      </Address>
    </ShipTo>
    <ShipFrom>
      <Address>
        <StateProvinceCode>CA</StateProvinceCode>
        <PostalCode>91803</PostalCode>
        <CountryCode>US</CountryCode>
      </Address>
    </ShipFrom>
    <ShipmentWeight>
      <UnitOfMeasurement>
        <Code>LBS</Code>
      </UnitOfMeasurement>
      <Weight>4.0</Weight>
    </ShipmentWeight>
    <Service>
      <Code>12</Code>
      <Description>UPS 3-Day Select</Description>
    </Service>
    <Package><PackagingType><Code>02</Code></PackagingType><Dimensions><UnitOfMeasurement><Code>IN</Code></UnitOfMeasurement><Length>2.00</Length><Width>2.00</Width><Height>2.00</Height></Dimensions><PackageWeight><UnitOfMeasurement><Code>LBS</Code><Description>Pounds</Description></UnitOfMeasurement><Weight>4.0</Weight></PackageWeight><PackageServiceOptions><InsuredValue><CurrencyCode>USD</CurrencyCode><MonetaryValue>64.99</MonetaryValue></InsuredValue></PackageServiceOptions></Package></Shipment>
</RatingServiceSelectionRequest>

What does code above mean ? No data was sent to UPS server ?

-akira

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
OK. Now put <?php 

OK. Now put

<?php
  drupal_set_message
('<pre>'. print_r($resp, true) .'</pre>');
?>

on line 887. The line that's actually making the request is being done, but this will show us what's actually happening.

akira's picture
Offline
Joined: 01/28/2008
Juice: 46
Lyle, You are right, that

Lyle,

You are right, that there is some errors.

    *
      stdClass Object
      (
          [error] => -1226988884 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
          [code] => 1226988884
      )

    *
      stdClass Object
      (
          [error] => -1226991860 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
          [code] => 1226991860
      )

    *

      stdClass Object
      (
          [error] => -1226989392 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
          [code] => 1226989392
      )

    *

      stdClass Object
      (
          [error] => -1226884500 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
          [code] => 1226884500
      )

    *

      stdClass Object
      (
          [error] => -1226887740 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
          [code] => 1226887740
      )

    *

      stdClass Object
      (
          [error] => -1226885176 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
          [code] => 1226885176
      )

But i don;t understand the meaning of those errors.

appreciate your help,
-akira

TR
TR's picture
Offline
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3424
Re: Lyle, You are right, that

On your web server, PHP has to be built with the flag --with-openssl. You currently don't have SSL support in PHP, and UPS quotes needs that.

<tr>.
japerry@drupal.org's picture
Offline
Bug FinderGetting busy with the Ubercode.Not Kulvik
Joined: 08/08/2007
Juice: 248
Re: Re: Lyle, You are right, that

I ran into this problem with a client system -- I'm thinking it'd be good to make a bug report to check for SSL and warn in the ubercart status box that --with-openssl is missing

TR
TR's picture
Offline
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3424
Re: Re: Re: Lyle, You are right, that

Yes, it would be nice to catch the error up front. However, it's not the UPS module per se that requires SSL, it's Drupal core. OpenSSL is required by drupal_http_request() whenever an HTTPS URL is requested. So I think this should be checked at a higher level in the food chain, so to speak. Practically, I think this means that Drupal should have OpenSSL as a dependency. But I guess Ubercart could take some defensive measures and display the status/error message at admin/logs/status rather than leave it to each individual shipping module (or other module requiring HTTPS) to deal with on its own - putting this into Ubercart would be a *lot* easier than getting Drupal fixed.

<tr>.
ksalling's picture
Offline
Joined: 02/19/2009
Juice: 34
Re: Re: Re: Re: Lyle, You are right, that

I agree it probably wouldn't be a very difficult solution for the ubercart devs. I should have posted 6 hours ago when I started working on this problem Smiling

My next hurdle is to get my host to enable openssl on the server. They are usually pretty good about that sort of thing but anytime you have to restart a service the techs hands start to get a bit twitchy.

ksalling's picture
Offline
Joined: 02/19/2009
Juice: 34
Re: Re: Re: Re: Re: Lyle, You are right, that

I just found out that in fact openSSL is enabled on my server... I am going to ask if anything on the server may be stopping outgoing connections... any other ideas?

5.X outputs the XML with no server response like is posted above
6.X just sits and spins that bar

could there be any issues related to these installations being on a subdomain?
also I made sure that the .htaccess rewrite baseurl was set to /

TR
TR's picture
Offline
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3424
Re: Re: Re: Re: Re: Re: Lyle, You are right, that

Create a script called phpinfo.php on your server containing this:

<?php
phpinfo
();
?>

Run it by hitting that script in your browser, e.g. http://www.example.com/phpinfo.php, then post the output here. This is the only way to tell for sure if your PHP has been built with OpenSSL.

<tr>.
ksalling's picture
Offline
Joined: 02/19/2009
Juice: 34
cURL support enabledcURL
cURL support enabled
cURL Information libcurl/7.19.2 OpenSSL/0.9.7a zlib/1.2.3 libidn/0.5.6

I found this when I searched it all for openSSL

ksalling's picture
Offline
Joined: 02/19/2009
Juice: 34
Re: cURL support enabledcURL

I also just added this code right after the $resp variable was set in uc_ups.module in the post above it looks like it prints the server response received from UPS

drupal_set_message('<pre>'. print_r($resp, true) .'</pre>');

This isn't doing anything though in the XML output I see.

ksalling's picture
Offline
Joined: 02/19/2009
Juice: 34
Re: Re: cURL support enabledcURL

Now I feel like an idiot...

below is my phpinfo() all I see is curlSSL no openSSL

I sent another support request because they apparantly dont get it.

--with-openssl is what I need.

'./configure' '--enable-bcmath' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-magic-quotes' '--enable-mbstring' '--enable-soap' '--enable-sockets' '--enable-wddx' '--prefix=/usr/local/php5-fcgi' '--with-bz2' '--with-curl=/opt/curlssl/' '--with-curlwrappers' '--with-freetype-dir=/usr' '--with-gd' '--with-gettext' '--with-imap=/opt/php_with_imap_client/' '--with-imap-ssl=/usr' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-libexpat-dir=/usr' '--with-libxml-dir=/opt/xml2' '--with-libxml-dir=/opt/xml2/' '--with-mcrypt=/opt/libmcrypt/' '--with-mhash=/opt/mhash/' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-pic' '--with-png-dir=/usr' '--with-pspell' '--with-ttf' '--with-xmlrpc' '--with-xpm-dir=/usr' '--with-xsl=/opt/xslt/' '--with-zlib' '--with-zlib-dir=/usr' '--enable-fastcgi' '--enable-discard-path' '--enable-force-cgi-redirect' '--enable-memory-limit' '--with-mysqli' '--with-pdo-mysql=/usr' '--disable-cli'
ksalling's picture
Offline
Joined: 02/19/2009
Juice: 34
FIXED: I had to go into my

FIXED:

I had to go into my cpanel and view the php configuration.

It was set on default but when I did phpinfo() on that install it brought up the configuration for php4
so by default my server was running php4

There was an option to explicitly select php5 which I did and everything automagically began working.

Hope this helps someone like me in the future and thanks to everyone that lent me a hand.

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Re: Re: Re: Re: Re: Re: Lyle, You are right, that

Hey, TR, Drupal actually has a page in the status report that displays phpinfo(). It's at admin/logs/status/php.