BraintreePlan

The PayPal for WooCommerce Braintree Plan class.

Defined (1)

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

/classes/lib/Braintree/Braintree/Plan.php  
  1. class Plan extends Base 
  2. public static function factory($attributes) 
  3. $instance = new self(); 
  4. $instance->_initialize($attributes); 
  5.  
  6. return $instance; 
  7.  
  8. protected function _initialize($attributes) 
  9. $this->_attributes = $attributes; 
  10.  
  11. $addOnArray = []; 
  12. if (isset($attributes['addOns'])) { 
  13. foreach ($attributes['addOns'] AS $addOn) { 
  14. $addOnArray[] = AddOn::factory($addOn); 
  15. $this->_attributes['addOns'] = $addOnArray; 
  16.  
  17. $discountArray = []; 
  18. if (isset($attributes['discounts'])) { 
  19. foreach ($attributes['discounts'] AS $discount) { 
  20. $discountArray[] = Discount::factory($discount); 
  21. $this->_attributes['discounts'] = $discountArray; 
  22.  
  23. $planArray = []; 
  24. if (isset($attributes['plans'])) { 
  25. foreach ($attributes['plans'] AS $plan) { 
  26. $planArray[] = self::factory($plan); 
  27. $this->_attributes['plans'] = $planArray; 
  28.  
  29.  
  30. // static methods redirecting to gateway 
  31.  
  32. public static function all() 
  33. return Configuration::gateway()->plan()->all();