コード例 #1
0
ファイル: Checkout.php プロジェクト: purchased-at/sdk-php
 /**
  * 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
ファイル: CheckoutItem.php プロジェクト: purchased-at/sdk-php
 /**
  * @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;
 }