TransactionLineItem.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace Braintree;
  3. use Braintree\Instance;
  4. /**
  5. * Line item associated with a transaction
  6. *
  7. * @package Braintree
  8. */
  9. /**
  10. * creates an instance of TransactionLineItem
  11. *
  12. *
  13. * @package Braintree
  14. *
  15. * @property-read string $quantity
  16. * @property-read string $name
  17. * @property-read string $description
  18. * @property-read string $kind
  19. * @property-read string $unitAmount
  20. * @property-read string $unitTaxAmount
  21. * @property-read string $totalAmount
  22. * @property-read string $discountAmount
  23. * @property-read string $unitOfMeasure
  24. * @property-read string $productCode
  25. * @property-read string $commodityCode
  26. * @property-read string $url
  27. */
  28. class TransactionLineItem extends Instance
  29. {
  30. // LineItem Kinds
  31. const CREDIT = 'credit';
  32. const DEBIT = 'debit';
  33. protected $_attributes = [];
  34. /**
  35. * @ignore
  36. */
  37. public function __construct($attributes)
  38. {
  39. parent::__construct($attributes);
  40. }
  41. public static function findAll($transactionId)
  42. {
  43. return Configuration::gateway()->transactionLineItem()->findAll($transactionId);
  44. }
  45. }
  46. class_alias('Braintree\TransactionLineItem', 'Braintree_TransactionLineItem');
  47. class_alias('Braintree\TransactionLineItem', 'Braintree\Transaction\LineItem');
  48. class_alias('Braintree\TransactionLineItem', 'Braintree_Transaction_LineItem');