BraintreeAndroidPayCard

Braintree AndroidPayCard module Creates and manages Braintree Android Pay cards.

Defined (1)

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

/classes/lib/Braintree/Braintree/AndroidPayCard.php  
  1. class AndroidPayCard extends Base 
  2. /** instance methods */ 
  3. /** 
  4. * returns false if default is null or false 
  5. * @return boolean 
  6. */ 
  7. public function isDefault() 
  8. return $this->default; 
  9.  
  10. /** 
  11. * factory method: returns an instance of AndroidPayCard 
  12. * to the requesting method, with populated properties 
  13. * @ignore 
  14. * @return AndroidPayCard 
  15. */ 
  16. public static function factory($attributes) 
  17. $defaultAttributes = [ 
  18. 'expirationMonth' => '',  
  19. 'expirationYear' => '',  
  20. 'last4' => $attributes['virtualCardLast4'],  
  21. 'cardType' => $attributes['virtualCardType'],  
  22. ]; 
  23.  
  24. $instance = new self(); 
  25. $instance->_initialize(array_merge($defaultAttributes, $attributes)); 
  26. return $instance; 
  27.  
  28. /** 
  29. * sets instance properties from an array of values 
  30. * @access protected 
  31. * @param array $androidPayCardAttribs array of Android Pay card properties 
  32. * @return void 
  33. */ 
  34. protected function _initialize($androidPayCardAttribs) 
  35. // set the attributes 
  36. $this->_attributes = $androidPayCardAttribs; 
  37.  
  38. $subscriptionArray = []; 
  39. if (isset($androidPayCardAttribs['subscriptions'])) { 
  40. foreach ($androidPayCardAttribs['subscriptions'] AS $subscription) { 
  41. $subscriptionArray[] = Subscription::factory($subscription); 
  42.  
  43. $this->_set('subscriptions', $subscriptionArray);