PayPal\Api\Details::setTax PHP Method

setTax() public method

Amount charged for tax. 10 characters max with support for 2 decimal places.
public setTax ( string | double $tax )
$tax string | double
    public function setTax($tax)
    {
        NumericValidator::validate($tax, "Tax");
        $tax = FormatConverter::formatToPrice($tax);
        $this->tax = $tax;
        return $this;
    }

Usage Example

コード例 #1
0
ファイル: TransactionHelper.php プロジェクト: metisfw/paypal
 /**
  * @param float $shippingPrice
  * @param float $taxPrice
  * @param float $subtotal
  *
  * @return Details
  */
 public static function createDetails($shippingPrice, $taxPrice, $subtotal)
 {
     $details = new Details();
     $details->setShipping($shippingPrice);
     $details->setTax($taxPrice);
     $details->setSubtotal($subtotal);
     return $details;
 }
All Usage Examples Of PayPal\Api\Details::setTax