This repository has been archived on 2026-04-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
PayPal-PHP-SDK/lib/PayPal/Api/TransactionFee.php
2015-02-03 12:19:34 +11:00

71 lines
1.5 KiB
PHP

<?php
namespace PayPal\Api;
use PayPal\Common\PayPalModel;
use PayPal\Converter\FormatConverter;
use PayPal\Validation\NumericValidator;
/**
* Class TranactionFee
*
* Let's you specify details of the transaction fee.
*
* @package PayPal\Api
*
* @property string currency
* @property string value
*/
class TransactionFee extends PayPalModel
{
/**
* 3 letter currency code
*
*
* @param string $currency
*
* @return $this
*/
public function setCurrency($currency)
{
$this->currency = $currency;
return $this;
}
/**
* 3 letter currency code
*
* @return string
*/
public function getCurrency()
{
return $this->currency;
}
/**
* Total amount charged from the Payer account (or card) to Payee. In case of a refund, this is the refunded amount to the original Payer from Payee account.
*
*
* @param string|double $value
*
* @return $this
*/
public function setValue($value)
{
NumericValidator::validate($value, "value");
$value = FormatConverter::formatToPrice($value, $this->getCurrency());
$this->value = $value;
return $this;
}
/**
* Value amount charged from the Payer account (or card) to Payee. In case of a refund, this is the refunded amount to the original Payer from Payee account.
*
* @return string
*/
public function getValue()
{
return $this->value;
}
}