UnknownPaymentMethod.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. namespace Braintree;
  3. /**
  4. * Braintree UnknownPaymentMethod module
  5. *
  6. * @package Braintree
  7. * @category Resources
  8. */
  9. /**
  10. * Manages Braintree UnknownPaymentMethod
  11. *
  12. * <b>== More information ==</b>
  13. *
  14. *
  15. * @package Braintree
  16. * @category Resources
  17. *
  18. * @property-read string $token
  19. * @property-read string $imageUrl
  20. */
  21. class UnknownPaymentMethod extends Base
  22. {
  23. /**
  24. * factory method: returns an instance of UnknownPaymentMethod
  25. * to the requesting method, with populated properties
  26. *
  27. * @ignore
  28. * @return UnknownPaymentMethod
  29. */
  30. public static function factory($attributes)
  31. {
  32. $instance = new self();
  33. $values = array_values($attributes);
  34. $instance->_initialize(array_shift($values));
  35. return $instance;
  36. }
  37. /* instance methods */
  38. /**
  39. * returns false if default is null or false
  40. *
  41. * @return boolean
  42. */
  43. public function isDefault()
  44. {
  45. return $this->default;
  46. }
  47. /**
  48. * sets instance properties from an array of values
  49. *
  50. * @access protected
  51. * @param array $unknownPaymentMethodAttribs array of unknownPaymentMethod data
  52. * @return void
  53. */
  54. protected function _initialize($unknownPaymentMethodAttribs)
  55. {
  56. // set the attributes
  57. $this->imageUrl = 'https://assets.braintreegateway.com/payment_method_logo/unknown.png';
  58. $this->_attributes = $unknownPaymentMethodAttribs;
  59. }
  60. }
  61. class_alias('Braintree\UnknownPaymentMethod', 'Braintree_UnknownPaymentMethod');