BraintreeResultCreditCardVerification

Braintree Credit Card Verification Result.

Defined (1)

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

/includes/lib/Braintree/lib/Braintree/Result/CreditCardVerification.php  
  1. class CreditCardVerification 
  2. // Status 
  3. const FAILED = 'failed'; 
  4. const GATEWAY_REJECTED = 'gateway_rejected'; 
  5. const PROCESSOR_DECLINED = 'processor_declined'; 
  6. const VERIFIED = 'verified'; 
  7.  
  8. private $_attributes; 
  9. private $_avsErrorResponseCode; 
  10. private $_avsPostalCodeResponseCode; 
  11. private $_avsStreetAddressResponseCode; 
  12. private $_cvvResponseCode; 
  13. private $_gatewayRejectionReason; 
  14. private $_status; 
  15.  
  16. /** 
  17. * @ignore 
  18. */ 
  19. public function __construct($attributes) 
  20. $this->_initializeFromArray($attributes); 
  21.  
  22. /** 
  23. * initializes instance properties from the keys/values of an array 
  24. * @ignore 
  25. * @access protected 
  26. * @param <type> $aAttribs array of properties to set - single level 
  27. * @return void 
  28. */ 
  29. private function _initializeFromArray($attributes) 
  30. if(isset($attributes['riskData'])) 
  31. $attributes['riskData'] = RiskData::factory($attributes['riskData']); 
  32.  
  33. $this->_attributes = $attributes; 
  34. foreach($attributes AS $name => $value) { 
  35. $varName = "_$name"; 
  36. $this->$varName = $value; 
  37.  
  38. /** 
  39. * @ignore 
  40. */ 
  41. public function __get($name) 
  42. $varName = "_$name"; 
  43. return isset($this->$varName) ? $this->$varName : null; 
  44.  
  45. /** 
  46. * returns a string representation of the customer 
  47. * @return string 
  48. */ 
  49. public function __toString() 
  50. return __CLASS__ . '[' . 
  51. Util::attributesToString($this->_attributes) . ']'; 
  52.  
  53. public static function allStatuses() 
  54. return [ 
  55. CreditCardVerification::FAILED,  
  56. CreditCardVerification::GATEWAY_REJECTED,  
  57. CreditCardVerification::PROCESSOR_DECLINED,  
  58. CreditCardVerification::VERIFIED 
  59. ];