BraintreeUsBankAccount

Manages Braintree UsBankAccounts.

Defined (1)

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

/includes/lib/Braintree/lib/Braintree/UsBankAccount.php  
  1. class UsBankAccount extends Base 
  2. /** 
  3. * factory method: returns an instance of UsBankAccount 
  4. * to the requesting method, with populated properties 
  5. * @ignore 
  6. * @return UsBankAccount 
  7. */ 
  8. public static function factory($attributes) 
  9. $instance = new self(); 
  10. $instance->_initialize($attributes); 
  11. return $instance; 
  12.  
  13. /** instance methods */ 
  14.  
  15. /** 
  16. * sets instance properties from an array of values 
  17. * @access protected 
  18. * @param array $usBankAccountAttribs array of usBankAccount data 
  19. * @return void 
  20. */ 
  21. protected function _initialize($usBankAccountAttribs) 
  22. // set the attributes 
  23. $this->_attributes = $usBankAccountAttribs; 
  24.  
  25. $achMandate = isset($usBankAccountAttribs['achMandate']) ? 
  26. AchMandate::factory($usBankAccountAttribs['achMandate']) : 
  27. null; 
  28. $this->_set('achMandate', $achMandate); 
  29.  
  30. /** 
  31. * create a printable representation of the object as: 
  32. * ClassName[property=value, property=value] 
  33. * @return string 
  34. */ 
  35. public function __toString() 
  36. return __CLASS__ . '[' . 
  37. Util::attributesToString($this->_attributes) . ']'; 
  38.  
  39.  
  40. // static methods redirecting to gateway 
  41.  
  42. public static function find($token) 
  43. return Configuration::gateway()->usBankAccount()->find($token); 
  44.  
  45. public static function sale($token, $transactionAttribs) 
  46. $transactionAttribs['options'] = [ 
  47. 'submitForSettlement' => true 
  48. ]; 
  49. return Configuration::gateway()->usBankAccount()->sale($token, $transactionAttribs);