protected function parseFeeDetail($xml){
        $r = array();
        $r['FeeType'] = (string)$xml->FeeType;
        $r['FeeAmount'] = $this->parseMoney($xml->FeeAmount);
        if (isset($xml->FeePromotion)){
            $r['FeePromotion'] = $this->parseMoney($xml->FeePromotion);
        }
        if (isset($xml->TaxAmount)){
            $r['TaxAmount'] = $this->parseMoney($xml->TaxAmount);
        }
        $r['FinalFee'] = $this->parseMoney($xml->FinalFee);
        if (isset($xml->IncludedFeeDetailList)){
            $r['IncludedFeeDetailList'] = array();
            foreach($xml->IncludedFeeDetailList->children() as $x){
                $r['IncludedFeeDetailList'][] = $this->parseFeeDetail($x);
            }
        }
        return $r;
    }
protected function parseFeeDetail($xml){
        $r = array();
        $r['FeeType'] = (string)$xml->FeeType;
        $r['FeeAmount'] = $this->parseMoney($xml->FeeAmount);
        if (isset($xml->FeePromotion)){
            $r['FeePromotion'] = $this->parseMoney($xml->FeePromotion);
        }
        if (isset($xml->TaxAmount)){
            $r['TaxAmount'] = $this->parseMoney($xml->TaxAmount);
        }
        $r['FinalFee'] = $this->parseMoney($xml->FinalFee);
        if (isset($xml->IncludedFeeDetailList)){
            $r['IncludedFeeDetailList'] = array();
            foreach($xml->IncludedFeeDetailList->children() as $x){
                $r['IncludedFeeDetailList'][] = $this->parseFeeDetail($x);
            }
        }
        return $r;
    }
protected function parseFeeDetail ( $ xml ) { $ r = array ( ) ; $ r [ 'FeeType' ] = ( string ) $ xml -> FeeType ; $ r [ 'FeeAmount' ] = $ this -> parseMoney ( $ xml -> FeeAmount ) ; if ( isset ( $ xml -> FeePromotion ) ) { $ r [ 'FeePromotion' ] = $ this -> parseMoney ( $ xml -> FeePromotion ) ; } if ( isset ( $ xml -> TaxAmount ) ) { $ r [ 'TaxAmount' ] = $ this -> parseMoney ( $ xml -> TaxAmount ) ; } $ r [ 'FinalFee' ] = $ this -> parseMoney ( $ xml -> FinalFee ) ; if ( isset ( $ xml -> IncludedFeeDetailList ) ) { $ r [ 'IncludedFeeDetailList' ] = array ( ) ; foreach ( $ xml -> IncludedFeeDetailList -> children ( ) as $ x ) { $ r [ 'IncludedFeeDetailList' ] [ ] = $ this -> parseFeeDetail ( $ x ) ; } } return $ r ; }
Parses XML for a single fee detail into an array.
This structure is used recursively in fee estimates.
@param SimpleXMLElement $xml <p>Fee Detail node of the XML response from Amazon.</p>
@return array Parsed structure from XML
Parses XML for a single fee detail into an array . This structure is used recursively in fee estimates .