BraintreeAddOnGateway

The PayPal for WooCommerce Braintree AddOnGateway class.

Defined (1)

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

/classes/lib/Braintree/Braintree/AddOnGateway.php  
  1. class AddOnGateway 
  2. /** 
  3. * @var Gateway 
  4. */ 
  5. private $_gateway; 
  6.  
  7. /** 
  8. * @var Configuration 
  9. */ 
  10. private $_config; 
  11.  
  12. /** 
  13. * @var Http 
  14. */ 
  15. private $_http; 
  16.  
  17. /** 
  18. * @param Gateway $gateway 
  19. */ 
  20. public function __construct($gateway) 
  21. $this->_gateway = $gateway; 
  22. $this->_config = $gateway->config; 
  23. $this->_config->assertHasAccessTokenOrKeys(); 
  24. $this->_http = new Http($gateway->config); 
  25.  
  26. /** 
  27. * @return AddOn[] 
  28. */ 
  29. public function all() 
  30. $path = $this->_config->merchantPath() . '/add_ons'; 
  31. $response = $this->_http->get($path); 
  32.  
  33. $addOns = ["addOn" => $response['addOns']]; 
  34.  
  35. return Util::extractAttributeAsArray( 
  36. $addOns,  
  37. 'addOn' 
  38. );