GrantedPaymentInstrumentUpdate.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. namespace Braintree;
  3. /**
  4. * Braintree GrantedPaymentInstrumentUpdate module
  5. *
  6. * @package Braintree
  7. * @category Resources
  8. */
  9. /**
  10. * Manages Braintree GrantedPaymentInstrumentUpdate
  11. *
  12. * <b>== More information ==</b>
  13. *
  14. *
  15. * @package Braintree
  16. * @category Resources
  17. *
  18. * @property-read string $grantOwnerMerchantId
  19. * @property-read string $grantRecipientMerchantId
  20. * @property-read string $paymentMethodNonce
  21. * @property-read string $token
  22. * @property-read string $updatedFields
  23. */
  24. class GrantedPaymentInstrumentUpdate extends Base
  25. {
  26. /**
  27. * factory method: returns an instance of GrantedPaymentInstrumentUpdate
  28. * to the requesting method, with populated properties
  29. *
  30. * @ignore
  31. * @return GrantedPaymentInstrumentUpdate
  32. */
  33. public static function factory($attributes)
  34. {
  35. $instance = new self();
  36. $instance->_initialize($attributes);
  37. return $instance;
  38. }
  39. /* instance methods */
  40. /**
  41. * sets instance properties from an array of values
  42. *
  43. * @access protected
  44. * @param array $GrantedPaymentInstrumentAttribs array of grantedPaymentInstrumentUpdate data
  45. * @return void
  46. */
  47. protected function _initialize($grantedPaymentInstrumentUpdateAttribs)
  48. {
  49. // set the attributes
  50. $this->_attributes = $grantedPaymentInstrumentUpdateAttribs;
  51. $paymentMethodNonce = isset($grantedPaymentInstrumentUpdateAttribs['paymentMethodNonce']) ?
  52. GrantedPaymentInstrumentUpdate::factory($grantedPaymentInstrumentUpdateAttribs['paymentMethodNonce']) :
  53. null;
  54. $this->_set('paymentMethodNonce', $paymentMethodNonce);
  55. }
  56. /**
  57. * create a printable representation of the object as:
  58. * ClassName[property=value, property=value]
  59. * @return string
  60. */
  61. public function __toString()
  62. {
  63. return __CLASS__ . '[' .
  64. Util::attributesToString($this->_attributes) . ']';
  65. }
  66. }
  67. class_alias('Braintree\GrantedPaymentInstrumentUpdate', 'Braintree_GrantedPaymentInstrumentUpdate');