Skip to content

Commit

Permalink
Correctly handle domestic/international address switches
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert L. Carpenter committed Mar 28, 2013
1 parent 087cf70 commit 542e74b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Shipping/Endicia/Quoter.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ public function quote(){
*/ */
public function quoteXML(){ public function quoteXML(){
// domestic postal codes can only be 5 digits // domestic postal codes can only be 5 digits
$postal_code = $this->to->international ? $this->to->postal_code $postal_code = $this->to->isDomestic() ? substr($this->to->postal_code, 0, 5)
: substr($this->to->postal_code, 0, 5); : $this->to->postal_code;


$b = new Builder(); $b = new Builder();
$b->PostageRatesRequest $b->PostageRatesRequest
->nest( ->nest(
$this->authXML( $b ) $this->authXML( $b )
->MailClass( $this->to->international ? 'International' : 'Domestic' ) ->MailClass( $this->to->isDomestic() ? 'Domestic' : 'International' )
->WeightOz( $this->weight ) ->WeightOz( $this->weight )
->MailpieceShape('Parcel') ->MailpieceShape('Parcel')
->MailpieceDimensions ->MailpieceDimensions
Expand Down

0 comments on commit 542e74b

Please sign in to comment.