Skip to content

Commit

Permalink
Added foreign currencies support.
Browse files Browse the repository at this point in the history
  • Loading branch information
pavolbiely committed Nov 8, 2019
1 parent 8a462ed commit b3c7d2d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -708,13 +708,21 @@ public function asArray()
if ($this->cashOnDelivery) {
$package['cashOnDeliveryPrice'] = $this->cashOnDelivery->getPrice();
$package['cashOnDeliveryPayment'] = $this->cashOnDelivery->getType();
//$package['cashOnDeliveryCurrency'] = $this->cashOnDelivery::CURRENCIES[$this->cashOnDelivery->getCurrency()]; // results in error 500 from remote server

$currencyId = $this->cashOnDelivery->getCurrency();
if ($currencyId > 1) {
$package['cashOnDeliveryCurrency'] = $this->cashOnDelivery::CURRENCIES[$currencyId];
}
}

// package insurance
if ($this->insurance) {
$package['insurance'] = $this->insurance->getPrice();
//$package['insuranceCurrency'] = $this->insurance::CURRENCIES[$this->insurance->getCurrency()]; // results in error 500 from remote server

$currencyId = $this->insurance->getCurrency();
if ($currencyId > 1) {
$package['insuranceCurrency'] = $this->insurance::CURRENCIES[$currencyId];
}
}

// notifications
Expand Down

0 comments on commit b3c7d2d

Please sign in to comment.