PayPal\Api\Details::setFee PHP Method

setFee() public method

Fee charged by PayPal. In case of a refund, this is the fee amount refunded to the original receipient of the payment.
public setFee ( string | double $fee )
$fee string | double
    public function setFee($fee)
    {
        NumericValidator::validate($fee, "Fee");
        $fee = FormatConverter::formatToPrice($fee);
        $this->fee = $fee;
        return $this;
    }

Usage Example

Example #1
0
 public static function createAmountDetails()
 {
     $amountDetails = new Details();
     $amountDetails->setSubtotal(self::$subtotal);
     $amountDetails->setTax(self::$tax);
     $amountDetails->setShipping(self::$shipping);
     $amountDetails->setFee(self::$fee);
     return $amountDetails;
 }