BankcardExtInfo.py 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class BankcardExtInfo(object):
  6. def __init__(self):
  7. self._account_type = None
  8. self._bank_code = None
  9. self._inst_branch_name = None
  10. self._inst_city = None
  11. self._inst_name = None
  12. self._inst_province = None
  13. @property
  14. def account_type(self):
  15. return self._account_type
  16. @account_type.setter
  17. def account_type(self, value):
  18. self._account_type = value
  19. @property
  20. def bank_code(self):
  21. return self._bank_code
  22. @bank_code.setter
  23. def bank_code(self, value):
  24. self._bank_code = value
  25. @property
  26. def inst_branch_name(self):
  27. return self._inst_branch_name
  28. @inst_branch_name.setter
  29. def inst_branch_name(self, value):
  30. self._inst_branch_name = value
  31. @property
  32. def inst_city(self):
  33. return self._inst_city
  34. @inst_city.setter
  35. def inst_city(self, value):
  36. self._inst_city = value
  37. @property
  38. def inst_name(self):
  39. return self._inst_name
  40. @inst_name.setter
  41. def inst_name(self, value):
  42. self._inst_name = value
  43. @property
  44. def inst_province(self):
  45. return self._inst_province
  46. @inst_province.setter
  47. def inst_province(self, value):
  48. self._inst_province = value
  49. def to_alipay_dict(self):
  50. params = dict()
  51. if self.account_type:
  52. if hasattr(self.account_type, 'to_alipay_dict'):
  53. params['account_type'] = self.account_type.to_alipay_dict()
  54. else:
  55. params['account_type'] = self.account_type
  56. if self.bank_code:
  57. if hasattr(self.bank_code, 'to_alipay_dict'):
  58. params['bank_code'] = self.bank_code.to_alipay_dict()
  59. else:
  60. params['bank_code'] = self.bank_code
  61. if self.inst_branch_name:
  62. if hasattr(self.inst_branch_name, 'to_alipay_dict'):
  63. params['inst_branch_name'] = self.inst_branch_name.to_alipay_dict()
  64. else:
  65. params['inst_branch_name'] = self.inst_branch_name
  66. if self.inst_city:
  67. if hasattr(self.inst_city, 'to_alipay_dict'):
  68. params['inst_city'] = self.inst_city.to_alipay_dict()
  69. else:
  70. params['inst_city'] = self.inst_city
  71. if self.inst_name:
  72. if hasattr(self.inst_name, 'to_alipay_dict'):
  73. params['inst_name'] = self.inst_name.to_alipay_dict()
  74. else:
  75. params['inst_name'] = self.inst_name
  76. if self.inst_province:
  77. if hasattr(self.inst_province, 'to_alipay_dict'):
  78. params['inst_province'] = self.inst_province.to_alipay_dict()
  79. else:
  80. params['inst_province'] = self.inst_province
  81. return params
  82. @staticmethod
  83. def from_alipay_dict(d):
  84. if not d:
  85. return None
  86. o = BankcardExtInfo()
  87. if 'account_type' in d:
  88. o.account_type = d['account_type']
  89. if 'bank_code' in d:
  90. o.bank_code = d['bank_code']
  91. if 'inst_branch_name' in d:
  92. o.inst_branch_name = d['inst_branch_name']
  93. if 'inst_city' in d:
  94. o.inst_city = d['inst_city']
  95. if 'inst_name' in d:
  96. o.inst_name = d['inst_name']
  97. if 'inst_province' in d:
  98. o.inst_province = d['inst_province']
  99. return o