Business-CanadaPost

 view release on metacpan or  search on metacpan

README.mkdn  view on Meta::CPAN


- turnaroundtime

    Your turnaround time in hours.  This is the amount of time between receiving
    the order and shipping it out.  It is used to create a shipping and delivery
    date for the item.  If none is specified, it will default to what you have set
    in your profile.

    If you have nothing set in your profile, it will assume you are shipping next-day.

    (Default: none)

- merchantid

    This is your merchant ID assigned to you by Canada Post.  It usually begins with
    CPC\_.  You can use CPC\_DEMO\_XML if you're testing and using Canada Post's test
    servers. (Default: none.  You need to set this or the module will return a fatal
    error.)

- totalprice

    Total value of the shipment you're mailing.  This is used to calculate whether or
    not a signature will be required, and whether it will need to include more insurance
    to cover the item (beyond the $100 included in the original shipment.) (Default: 0.00)

- units

    Possible values are 'metric' and 'imperial'.

    If set to metric, you will be specifying height, length, and width in cm, and
    weight in kg.

    If set to imperial, you will be specifying height, length, and width in in, and
    weight in lb.

    (Default: metric)

- testing

    Possible values: 1 or 0.

    Specifies whether you're using a production account, or a testing account.  If you're
    in testing mode, you'll be connecting to Canada Post's test servers, which run on
    less stable hardware, on a slower link to the Internet, and are rate-throttled.

    (Default: 0)

- items

    An array containing the items in your shipment.  Array elements are:

    (quantity, weight, length, width, height, description, readytoship \[1 or 0\])

    readytoship specifies that you have the item already boxed or prepared for shipment.

    If this is set to 0, then Canada Post server's will calculate the most appropriate box
    listed in your account profile, and use it for its dimensions and shipping cost.

# OBJECT METHODS

Most errors are fatal.  The tool tries to guess for you if a value seems
out of whack.

## `geterror`

Used to fetch the error set when a function return 0 for failure.

Example:

```
    $object->getrequest or print "Error: " . $object->geterror() . "\n";
```

## `setlanguage`

Used to change the language.

Example:

```
    $object->setlanguage('fr'); # changes messages to french.
```

## `settocity`

Specifies city being shipped to.

Example:

```
    $object->settocity('New York');
```

## `settesting`

Specifies whether account is in testing.

Example:

```
    $object->settesting(1);
```

## `setcountry`

Specifies country being mailed to.

Example:

```
    $object->setcountry('United States');
```

## `setmerchantid`

Specifies Canada Post merchant ID.

Example:

```
    $object->setmerchantid('CPC_DEMO_XML');



( run in 1.692 second using v1.01-cache-2.11-cpan-98e64b0badf )