BraintreeMerchantAccount

The PayPal for WooCommerce Braintree MerchantAccount class.

Defined (1)

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

/classes/lib/Braintree/Braintree/MerchantAccount.php  
  1. final class MerchantAccount extends Base 
  2. const STATUS_ACTIVE = 'active'; 
  3. const STATUS_PENDING = 'pending'; 
  4. const STATUS_SUSPENDED = 'suspended'; 
  5.  
  6. const FUNDING_DESTINATION_BANK = 'bank'; 
  7. const FUNDING_DESTINATION_EMAIL = 'email'; 
  8. const FUNDING_DESTINATION_MOBILE_PHONE = 'mobile_phone'; 
  9.  
  10. public static function factory($attributes) 
  11. $instance = new self(); 
  12. $instance->_initialize($attributes); 
  13. return $instance; 
  14.  
  15. protected function _initialize($merchantAccountAttribs) 
  16. $this->_attributes = $merchantAccountAttribs; 
  17.  
  18. if (isset($merchantAccountAttribs['individual'])) { 
  19. $individual = $merchantAccountAttribs['individual']; 
  20. $this->_set('individualDetails', MerchantAccount\IndividualDetails::Factory($individual)); 
  21.  
  22. if (isset($merchantAccountAttribs['business'])) { 
  23. $business = $merchantAccountAttribs['business']; 
  24. $this->_set('businessDetails', MerchantAccount\BusinessDetails::Factory($business)); 
  25.  
  26. if (isset($merchantAccountAttribs['funding'])) { 
  27. $funding = $merchantAccountAttribs['funding']; 
  28. $this->_set('fundingDetails', new MerchantAccount\FundingDetails($funding)); 
  29.  
  30. if (isset($merchantAccountAttribs['masterMerchantAccount'])) { 
  31. $masterMerchantAccount = $merchantAccountAttribs['masterMerchantAccount']; 
  32. $this->_set('masterMerchantAccount', self::Factory($masterMerchantAccount)); 
  33.  
  34.  
  35. // static methods redirecting to gateway 
  36.  
  37. public static function create($attribs) 
  38. return Configuration::gateway()->merchantAccount()->create($attribs); 
  39.  
  40. public static function find($merchant_account_id) 
  41. return Configuration::gateway()->merchantAccount()->find($merchant_account_id); 
  42.  
  43. public static function update($merchant_account_id, $attributes) 
  44. return Configuration::gateway()->merchantAccount()->update($merchant_account_id, $attributes);