Re: UPS Package
| From: | Philippe Jausions | Date: | Fri, 03 Dec 2004 18:05:29 +0000 |
| Subject: | Re: UPS Package | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-34767@lists.php.net to get a copy of this message | ||
Hi,
Hummm... I think that would need clarification. What do you call "Tracking"? Is it the ability to register a parcel and get a tracking number or some kind of in-transit status information using a tracking number?
Also what does the "rates" service would provide? Cost for one parcel on one shipping service (i.e. Ground, Air, 2nd Air...), or comparative cost of one parcel for those multiple shipping services. This leads to the having a feature that returns a list of shipping services for that shipper (hint: use caching mechanism.) Should that list be standardized between shipper drivers? Answer is mixed: "Yes" to do easy rate comparison, but "No" for expansion/maintenance.
I'm not sure what you mean by the "Delivery Notification", would it be a pull or a push-registration if provided by shipper?
One thing to add, is Shipping Label link reference if supported. But I guess that could be part of returned values from a parcel "registration"...
As I said, before, a Wiki would be great to discuss all that...
-Philippe
Joe Stump wrote:
+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.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