Jump to content
Sign in to follow this  
FixItPete

Is USPS Down? I'm running what I think is API4 ... have a look?

Recommended Posts

Is there something wrong with USPS?

Here's my usps.php (the forum wouldn't let me post the whole thing... so here's part of it that mentions v4):

<?php  

/*

$Id: usps.php 5.2.1 - 2.2. RC2a  and 2.3 compatible; php 5.3 compatible

+++++ Original contribution by Brad Waite and Fritz Clapp ++++

++++ Revisions and Modifications made by Greg Deeth, 2008 ++++

Copyright 2008 osCommerce

Released under the GNU General Public License

//VERSION: 5.2.1 Updated to July 28 2013 Changes

*/



/////////////////////////////////////////

////////// Sets up USPS Class ///////////

/////////////////////////////////////////



class usps

{



    /////////////////////////////////////////

    ///////////// Sets Variables ////////////

    /////////////////////////////////////////

    

    var $code, $title, $description, $icon, $enabled, $countries;

    

    function usps()

        {

        if ( !function_exists('htmlspecialchars_decode') )

        {

          function htmlspecialchars_decode($text)

          {

             return strtr($text, array_flip(get_html_translation_table(HTML_SPECIALCHARS)));

           }

        }

        global $order;

        $this->code = 'usps';
.
.
.
.
.
.
.

                    break;

                    case 'Priority Commercial': $transreq[$transid] = 'API=PriorityMail&XML=' .

                        urlencode( '<PriorityMailRequest ' . $transitreq . '</PriorityMailRequest>');

                    break;

                    default:    $transreq[$transid] = '';

                    break;

                    }

                }

        

                /////////////////////////////////////////

                //////// END USPS TRANSIT REQUEST ///////

                /////////////////////////////////////////



            $services_count++;

            }



            /////////////////////////////////////////

            ////// END IF WITHIN ALLOWED LIST ///////

            /////////////////////////////////////////



        $request .= '</RateV4Request>';

        $request =     'API=RateV4&XML=' . urlencode($request);

        }

        

        /////////////////////////////////////////

        /////// END USPS DOMESTIC REQUEST ///////

        /////////////////////////////////////////



         else

    

        /////////////////////////////////////////

        //// START USPS INTERNATIONAL REQUEST ///

        /////////////////////////////////////////

        

        {

        $request =     '<IntlRateV2Request USERID="' . $Authentication[0] . '">' .

                    '<Revision>2</Revision>' .

                    '<Package ID="0">' .

                    '<Pounds>' . $this->pounds . '</Pounds>' .

                    '<Ounces>' . $this->ounces . '</Ounces>' .

                    '<Machinable>True</Machinable>' .

                    '<MailType>All</MailType>' .

                    '<GXG>' .

                        '<POBoxFlag>N</POBoxFlag>' .




Something I need to do?  Please help. :)

Thanks!


I find the fun in everything.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×