<?php
namespace App\Worldspan\StructureParser\Structures\RefundRaw; class Price extends \App\Worldspan\StructureParser\Structures\Base\Price { protected function _getData() { list($parsedStructure, , $transactionIndexes, ) = $this->getTransactionDetails(); $item = new \App\Worldspan\StructureParser\Types\Price(); $RJ = $parsedStructure['passenger'][$transactionIndexes['paxIdx']]['RJ']; $currency = $this->determineCurrency($parsedStructure, [], [], null, $RJ, []); $item->total = -1*($RJ['TotalRefundAmount']); $item->totalCurrency = ($RJ['CurrencyCodeOfTotalFare']?:$currency); $item->supplier = -1*($RJ['BaseFareAmountOfRefund']); $item->supplierCurrency = ($RJ['CurrencyCode']?:$currency); $item->penalty = 1*($RJ['AdminPenaltyFeeAmount']); $item->penaltyCurrency = $item->supplierCurrency; $item->total+= $item->penalty; if ($item->totalCurrency==$item->supplierCurrency && $item->totalCurrency==$item->penaltyCurrency ) { $item->tax->add(new \App\Worldspan\StructureParser\Types\PriceTaxComponent('custom', ($item->total - $item->supplier - $item->penalty), $item->supplierCurrency)); } return $item; } } 