Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use value-object for setting up rate requests #7

Open
pdt256 opened this issue Dec 8, 2014 · 0 comments
Open

Use value-object for setting up rate requests #7

pdt256 opened this issue Dec 8, 2014 · 0 comments

Comments

@pdt256
Copy link
Owner

pdt256 commented Dec 8, 2014

Convert the following request to use value objects.

$ups = new UPS\Rate([
    'prod'           => FALSE,
    'accessKey'      => 'XXXX',
    'userId'         => 'XXXX',
    'password'       => 'XXXX',
    'shipperNumber'  => 'XXXX',
    'shipment'       => $shipment,
    'approvedCodes'  => [
        '03', // 1-5 business days
        '02', // 2 business days
        '01', // next business day 10:30am
        '13', // next business day by 3pm
        '14', // next business day by 8am
    ],
    'requestAdapter' => new RateRequest\StubUPS(),
]);

Example:

$ups = new UPS\Rate;
$ups->setIsProduction(false);
$ups->setAccessKey('XXXX');
$ups->setUserId('XXXX');
$ups->setShipperNumber('XXXX');
$ups->setShipment($shipment);
$ups->setApprovedCodes([
    '03', // 1-5 business days
    '02', // 2 business days
    '01', // next business day 10:30am
    '13', // next business day by 3pm
    '14', // next business day by 8am
]);
$ups->setRequestAdapter(new RateRequest\StubUPS());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant