PayPalApiAmount

Class Amount.

Defined (1)

The class is defined in the following location(s).

/classes/lib/PayPal/Api/Amount.php  
  1. class Amount extends PayPalModel 
  2. /** 
  3. * 3-letter [currency code](https://developer.paypal.com/docs/integration/direct/rest_api_payment_country_currency_support/). PayPal does not support all currencies. 
  4. * @param string $currency 
  5. * @return $this 
  6. */ 
  7. public function setCurrency($currency) 
  8. $this->currency = $currency; 
  9. return $this; 
  10.  
  11. /** 
  12. * 3-letter [currency code](https://developer.paypal.com/docs/integration/direct/rest_api_payment_country_currency_support/). PayPal does not support all currencies. 
  13. * @return string 
  14. */ 
  15. public function getCurrency() 
  16. return $this->currency; 
  17.  
  18. /** 
  19. * Total amount charged from the payer to the payee. In case of a refund, this is the refunded amount to the original payer from the payee. 10 characters max with support for 2 decimal places. 
  20. * @param string|double $total 
  21. * @return $this 
  22. */ 
  23. public function setTotal($total) 
  24. NumericValidator::validate($total, "Total"); 
  25. $total = FormatConverter::formatToPrice($total, $this->getCurrency()); 
  26. $this->total = $total; 
  27. return $this; 
  28.  
  29. /** 
  30. * Total amount charged from the payer to the payee. In case of a refund, this is the refunded amount to the original payer from the payee. 10 characters max with support for 2 decimal places. 
  31. * @return string 
  32. */ 
  33. public function getTotal() 
  34. return $this->total; 
  35.  
  36. /** 
  37. * Additional details of the payment amount. 
  38. * @param \PayPal\Api\Details $details 
  39. * @return $this 
  40. */ 
  41. public function setDetails($details) 
  42. $this->details = $details; 
  43. return $this; 
  44.  
  45. /** 
  46. * Additional details of the payment amount. 
  47. * @return \PayPal\Api\Details 
  48. */ 
  49. public function getDetails() 
  50. return $this->details; 
  51.