BraintreeDispute

Creates an instance of Dispute as returned from a transaction.

Defined (1)

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

/classes/lib/Braintree/Braintree/Dispute.php  
  1. final class Dispute extends Base 
  2. protected $_attributes = []; 
  3.  
  4. /** Dispute Status */ 
  5. const OPEN = 'open'; 
  6. const WON = 'won'; 
  7. const LOST = 'lost'; 
  8.  
  9. /** deprecated; for backwards compatibilty */ 
  10. const Open = 'open'; 
  11.  
  12. /** Dispute Reason */ 
  13. const CANCELLED_RECURRING_TRANSACTION = "cancelled_recurring_transaction"; 
  14. const CREDIT_NOT_PROCESSED = "credit_not_processed"; 
  15. const DUPLICATE = "duplicate"; 
  16. const FRAUD = "fraud"; 
  17. const GENERAL = "general"; 
  18. const INVALID_ACCOUNT = "invalid_account"; 
  19. const NOT_RECOGNIZED = "not_recognized"; 
  20. const PRODUCT_NOT_RECEIVED = "product_not_received"; 
  21. const PRODUCT_UNSATISFACTORY = "product_unsatisfactory"; 
  22. const TRANSACTION_AMOUNT_DIFFERS = "transaction_amount_differs"; 
  23. const RETRIEVAL = "retrieval"; 
  24.  
  25. /** Dispute Kind */ 
  26. const CHARGEBACK = 'chargeback'; 
  27. const PRE_ARBITRATION = 'pre_arbitration'; 
  28. // RETRIEVAL for kind already defined under Dispute Reason 
  29.  
  30. protected function _initialize($disputeAttribs) 
  31. $this->_attributes = $disputeAttribs; 
  32.  
  33. if (isset($disputeAttribs['transaction'])) { 
  34. $this->_set('transactionDetails',  
  35. new Dispute\TransactionDetails($disputeAttribs['transaction']) 
  36. ); 
  37.  
  38. public static function factory($attributes) 
  39. $instance = new self(); 
  40. $instance->_initialize($attributes); 
  41. return $instance; 
  42.  
  43. public function __toString() 
  44. $display = [ 
  45. 'amount', 'reason', 'status',  
  46. 'replyByDate', 'receivedDate', 'currencyIsoCode' 
  47. ]; 
  48.  
  49. $displayAttributes = []; 
  50. foreach ($display AS $attrib) { 
  51. $displayAttributes[$attrib] = $this->$attrib; 
  52. return __CLASS__ . '[' . 
  53. Util::attributesToString($displayAttributes) .']';