BraintreePlanGateway

The PayPal for WooCommerce Braintree PlanGateway class.

Defined (1)

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

/classes/lib/Braintree/Braintree/PlanGateway.php  
  1. class PlanGateway 
  2. private $_gateway; 
  3. private $_config; 
  4. private $_http; 
  5.  
  6. public function __construct($gateway) 
  7. $this->_gateway = $gateway; 
  8. $this->_config = $gateway->config; 
  9. $this->_config->assertHasAccessTokenOrKeys(); 
  10. $this->_http = new Http($gateway->config); 
  11.  
  12. public function all() 
  13. $path = $this->_config->merchantPath() . '/plans'; 
  14. $response = $this->_http->get($path); 
  15. if (key_exists('plans', $response)) { 
  16. $plans = ["plan" => $response['plans']]; 
  17. } else { 
  18. $plans = ["plan" => []]; 
  19.  
  20. return Util::extractAttributeAsArray( 
  21. $plans,  
  22. 'plan' 
  23. );