Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

vend::ship::queryups(3pm) [debian man page]

Vend::Ship::QueryUPS(3pm)				User Contributed Perl Documentation				 Vend::Ship::QueryUPS(3pm)

NAME
Vend::Ship::QueryUPS -- calculate UPS costs via www SYNOPSIS
(catalog.cfg) Shipping QueryUPS default_geo 45056 (shipping.asc) ground: UPS Ground Commercial origin 45056 service GNDCOM min 0 max 0 cost e Nothing to ship! min 0 max 150 cost s QueryUPS min 150 max 99999999 cost e Too heavy for UPS. DESCRIPTION
Calculates UPS costs via the WWW using Business::UPS. To activate, configure any parameter in catalog.cfg. A good choice is the default origin zip. Options: weight Weight in pounds. Required -- normally passed via CRIT parameter. service Any valid Business::UPS mode (required). Example: 1DA,2DA,GNDCOM. Defaults to the mode name. geo Location of field containing zip code. Default is 'zip'. country_field Location of field containing country code. Default is 'country'. default_geo The ZIP code to use if none supplied -- for defaulting shipping to some value in absence of ZIP. No default -- will return 0 and error if no zip. default_country The country code to use if none supplied -- for defaulting shipping to some value in absence of country. Default US. aggregate If 1, aggregates by a call to weight=150 (or $Variable->{UPS_QUERY_MODULO}). Multiplies that times number necessary, then runs a call for the remainder. In other words: [ups-query weight=400 mode=GNDCOM aggregate=1] is equivalent to: [calc] [ups-query weight=150 mode=GNDCOM] + [ups-query weight=150 mode=GNDCOM] + [ups-query weight=100 mode=GNDCOM]; [/calc] If set to a number above 1, will be the modulo to do repeated calls by. So: [ups-query weight=400 mode=GNDCOM aggregate=100] is equivalent to: [calc] [ups-query weight=100 mode=GNDCOM] + [ups-query weight=100 mode=GNDCOM] + [ups-query weight=100 mode=GNDCOM] + [ups-query weight=100 mode=GNDCOM]; [/calc] To aggregate by 1, use .999999. cache_table Set to the name of a table (default ups_cache) which can cache the calls so repeated calls for the same values will not require repeated calls to UPS. Table needs to be set up with: Database ups_cache ship/ups_cache.txt __SQLDSN__ Database ups_cache AUTO_SEQUENCE ups_cache_seq Database ups_cache DEFAULT_TYPE varchar(12) Database ups_cache INDEX weight origin zip shipmode country And have the fields: code weight origin zip country shipmode cost updated Typical cached data will be like: code weight origin zip country shipmode cost updated 14 11 45056 99501 US 2DA 35.14 1052704130 15 11 45056 99501 US 1DA 57.78 1052704130 16 11 45056 99501 US 2DA 35.14 1052704132 17 11 45056 99501 US 1DA 57.78 1052704133 Cache expires in one day. perl v5.14.2 2010-03-25 Vend::Ship::QueryUPS(3pm)

Check Out this Related Man Page

UPSCLI_LIST_START(3)						    NUT Manual						      UPSCLI_LIST_START(3)

NAME
upscli_list_start - begin multi-item retrieval from a UPS SYNOPSIS
#include <upsclient.h> int upscli_list_start(UPSCONN_t *ups, int numq, const char **query) DESCRIPTION
The upscli_list_start() function takes the pointer ups to a UPSCONN_t state structure, and the pointer query to an array of numq query elements. It builds a properly-formatted request from those elements and transmits it to upsd(8). Upon success, the caller must call upscli_list_next(3) to retrieve the elements of the list. Failure to retrieve the list will most likely result in the client getting out of sync with the server due to buffered data. USES
This function implements the "LIST" command in the protocol. As a result, you can use it to request many different things from the server. Some examples are: o LIST UPS o LIST VAR <ups> o LIST RW <ups> o LIST CMD <ups> o LIST ENUM <ups> <var> o LIST RANGE <ups> <var> QUERY FORMATTING
To see the list of variables on a UPS called su700, the protocol command would be LIST VAR su700. To start that list with this function, you would populate query and numq as follows: int numq; const char *query[2]; query[0] = "VAR"; query[1] = "su700"; numq = 2; All escaping of special characters and quoting of elements with spaces are handled for you inside this function. ERROR CHECKING
This function checks the response from upsd(8) against your query. If it is not starting a list, or is starting the wrong type of list, it will return an error code. When this happens, upscli_upserror(3) will return UPSCLI_ERR_PROTOCOL. RETURN VALUE
The upscli_list_start() function returns 0 on success, or -1 if an error occurs. SEE ALSO
upscli_fd(3), upscli_get(3), upscli_readline(3), upscli_sendline(3), upscli_ssl(3), upscli_strerror(3), upscli_upserror(3) Network UPS Tools 05/31/2012 UPSCLI_LIST_START(3)
Man Page