BraintreeDiscountGateway

The Paid Memberships Pro Braintree DiscountGateway class.

Defined (1)

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

/includes/lib/Braintree/lib/Braintree/DiscountGateway.php  
  1. class DiscountGateway 
  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() . '/discounts'; 
  14. $response = $this->_http->get($path); 
  15.  
  16. $discounts = ["discount" => $response['discounts']]; 
  17.  
  18. return Util::extractAttributeAsArray( 
  19. $discounts,  
  20. 'discount' 
  21. );