예제 #1
0
 /**
  * Set the total value of all items (sum of all items: $item->count * $item->price).
  *
  * @param $currency string ISO3 currency code
  * @param $total string total value of all goods in $currency
  * @return $this
  */
 public function addTotal($currency, $total)
 {
     Preconditions::checkIso3Currency($currency, 'currency');
     Preconditions::checkFloat($total, 'total');
     $this->total[$currency] = $total;
     return $this;
 }
예제 #2
0
 /**
  * @param string $currency ISO4271 3 letter currency code (USD,EUR,..)
  * @return Test
  */
 public function setCurrency($currency)
 {
     Preconditions::checkIso3Currency($currency, 'currency');
     $this->currency = $currency;
     return $this;
 }
예제 #3
0
 /**
  * @param $currency string ISO3 currency code
  * @param $price string price ofe item in specified currency
  * @return $this
  */
 public function addPrice($currency, $price)
 {
     Preconditions::checkIso3Currency($currency, 'currency');
     Preconditions::checkFloat($price, 'price');
     $this->price[$currency] = $price;
     return $this;
 }