Re: UPS Package

From: Date: Fri, 03 Dec 2004 17:21:51 +0000
Subject: Re: UPS Package
References: 1 2 3 4 5 6  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-34766@lists.php.net to get a copy of this message
+1 here :) We did this with PP for payment types. Works great. I see at least two major functions (maybe three) that ALL drivers should support: 1.) Rates (ie. Package X costs $Y) 2.) Tracking 3.) Delivery notification (ie. Has the package arrived?) I believe that all of the shippers support this at the very least. USPS does not do tracking or delivery notification by default though so it would have to fail gracefully. --Joe On Dec 3, 2004, at 8:59 AM, Philippe Jausions wrote:
Joe Stump wrote:
On Dec 3, 2004, at 7:23 AM, bertrand Gugger wrote:
Joe Stump wrote:
Fine by me. The RFP only asked for shipping rates and, being the lazy guy I am, I only delivered that :) The docs and field maps are good to have for sure.
What docs and maps you mean ?
The docs and field maps I sent in the code yesterday. I'm up for chatting wherever. I just need a heads up as to where and when.
Just an idea, but parcels themselves should be PHP objects. This would make actually real sense to use an object to store the parcel physical properties and monetary value. You could simply pass the object to different shipping services to check rates or whatever... We could also use a simple array, but having an object could be usefull to encapsulate methods if need be... class Service_Shipping_Parcel {
    /**
     * Weight of parcel
     *
     * Weight in grams, since this is international weight unit.
     * @todo: provide weight conversion
     */
    var $weight;
    /**
     * Three-dimension array (in centimeters)
     *
     * Should it provide 0, 1, 2 or 'height', 'width', 'length' indexes?
     * @todo: provide size conversion
     */
    var $dimensions;
    /**
     * Parcel type
     *
     * One of: 'Parcel', 'Letter'...
     */
    var $type = 'Parcel';
    /**
     * Value (for customs for instance)
     */
    var $value = 0;
    /**
     * Content description
     */
    var $contemt = '';
    /**
     * Currency for monetary values
     *
     * @todo Find list of ISO standard currencies...
     */
    var $currency;
    /**
     * Content type
     * One of: 'Safe', 'Hazardeous'...
     */
    var $contentType = 'Safe';
    /**
     * Not sure if insurance should be part of the package
     */
    var $insuredValue = 0;
    /**
     * Handling
     * One or more of: 'Normal', 'Fragile', 'Heavy',
     *    'TemperatureSensitive'
     * May need a bitwise, extra properties or an array...?
     */
    var $handling = 'Normal';
    /**
     * Returns a string description of the parcel
     */
    function toString()
    {
        return '';
    }
} Yes, it is a bit of a glorified array, but this is great for auto-documentation and expandability. -Philippe


« previous php.pear.dev (#34766) next »