BraintreeCoinbaseAccount

Manages Braintree CoinbaseAccounts.

Defined (1)

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

/includes/lib/Braintree/lib/Braintree/CoinbaseAccount.php  
  1. class CoinbaseAccount extends Base 
  2. /** 
  3. * factory method: returns an instance of CoinbaseAccount 
  4. * to the requesting method, with populated properties 
  5. * @ignore 
  6. * @return CoinbaseAccount 
  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. * returns false if default is null or false 
  17. * @return boolean 
  18. */ 
  19. public function isDefault() 
  20. return $this->default; 
  21.  
  22. /** 
  23. * sets instance properties from an array of values 
  24. * @access protected 
  25. * @param array $coinbaseAccountAttribs array of coinbaseAccount data 
  26. * @return void 
  27. */ 
  28. protected function _initialize($coinbaseAccountAttribs) 
  29. // set the attributes 
  30. $this->_attributes = $coinbaseAccountAttribs; 
  31.  
  32. $subscriptionArray = []; 
  33. if (isset($coinbaseAccountAttribs['subscriptions'])) { 
  34. foreach ($coinbaseAccountAttribs['subscriptions'] AS $subscription) { 
  35. $subscriptionArray[] = Subscription::factory($subscription); 
  36.  
  37. $this->_set('subscriptions', $subscriptionArray); 
  38.  
  39. /** 
  40. * create a printable representation of the object as: 
  41. * ClassName[property=value, property=value] 
  42. * @return string 
  43. */ 
  44. public function __toString() 
  45. return __CLASS__ . '[' . 
  46. Util::attributesToString($this->_attributes) .']'; 
  47.  
  48.  
  49. // static methods redirecting to gateway 
  50.  
  51. public static function find($token) 
  52. return Configuration::gateway()->coinbaseAccount()->find($token); 
  53.  
  54. public static function update($token, $attributes) 
  55. return Configuration::gateway()->coinbaseAccount()->update($token, $attributes); 
  56.  
  57. public static function delete($token) 
  58. return Configuration::gateway()->coinbaseAccount()->delete($token); 
  59.  
  60. public static function sale($token, $transactionAttribs) 
  61. return Configuration::gateway()->coinbaseAccount()->sale($token, $transactionAttribs);