Skip to content

Commit

Permalink
Merge pull request #26 from scufa/negotiated-rates
Browse files Browse the repository at this point in the history
NegotiatedRates in Rate Response
  • Loading branch information
gabrielbull committed Apr 24, 2015
2 parents 0943f31 + f71cf0c commit 2c71efa
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/Ups/Entity/NegotiatedRates.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace Ups\Entity;

class NegotiatedRates
{

/**
* @var NetSummaryCharges
*/
public $NetSummaryCharges;

function __construct($response = null)
{
$this->NetSummaryCharges = new NetSummaryCharges();

if (null !== $response) {
if (isset($response->NetSummaryCharges)) {
$this->NetSummaryCharges = new NetSummaryCharges($response->NetSummaryCharges);
}
}
}

}
32 changes: 32 additions & 0 deletions src/Ups/Entity/NetSummaryCharges.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace Ups\Entity;

class NetSummaryCharges
{

/**
* @var Charges
*/
public $GrandTotal;

/**
* @var Charges|null
*/
public $TotalChargesWithTaxes;

function __construct($response = null)
{
$this->GrandTotal = new Charges();

if (null !== $response) {
if (isset($response->GrandTotal)) {
$this->GrandTotal = new Charges($response->GrandTotal);
}
if (isset($response->TotalChargesWithTaxes)) {
$this->TotalChargesWithTaxes = new Charges($response->TotalChargesWithTaxes);
}
}
}

}
8 changes: 8 additions & 0 deletions src/Ups/Entity/RatedShipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ class RatedShipment
public $ScheduledDeliveryTime;
public $RatedPackage;
public $SurCharges;
/**
* @var NegotiatedRates|null
*/
public $NegotiatedRates;

function __construct($response = null)
{
Expand Down Expand Up @@ -63,6 +67,10 @@ function __construct($response = null)
}
}

if (isset($response->NegotiatedRates)) {
$this->NegotiatedRates = new NegotiatedRates($response->NegotiatedRates);
}

}

}
Expand Down

0 comments on commit 2c71efa

Please sign in to comment.