SettleCardInfo.py 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class SettleCardInfo(object):
  6. def __init__(self):
  7. self._account_branch_name = None
  8. self._account_holder_name = None
  9. self._account_inst_city = None
  10. self._account_inst_id = None
  11. self._account_inst_name = None
  12. self._account_inst_province = None
  13. self._account_no = None
  14. self._account_type = None
  15. self._bank_code = None
  16. self._usage_type = None
  17. @property
  18. def account_branch_name(self):
  19. return self._account_branch_name
  20. @account_branch_name.setter
  21. def account_branch_name(self, value):
  22. self._account_branch_name = value
  23. @property
  24. def account_holder_name(self):
  25. return self._account_holder_name
  26. @account_holder_name.setter
  27. def account_holder_name(self, value):
  28. self._account_holder_name = value
  29. @property
  30. def account_inst_city(self):
  31. return self._account_inst_city
  32. @account_inst_city.setter
  33. def account_inst_city(self, value):
  34. self._account_inst_city = value
  35. @property
  36. def account_inst_id(self):
  37. return self._account_inst_id
  38. @account_inst_id.setter
  39. def account_inst_id(self, value):
  40. self._account_inst_id = value
  41. @property
  42. def account_inst_name(self):
  43. return self._account_inst_name
  44. @account_inst_name.setter
  45. def account_inst_name(self, value):
  46. self._account_inst_name = value
  47. @property
  48. def account_inst_province(self):
  49. return self._account_inst_province
  50. @account_inst_province.setter
  51. def account_inst_province(self, value):
  52. self._account_inst_province = value
  53. @property
  54. def account_no(self):
  55. return self._account_no
  56. @account_no.setter
  57. def account_no(self, value):
  58. self._account_no = value
  59. @property
  60. def account_type(self):
  61. return self._account_type
  62. @account_type.setter
  63. def account_type(self, value):
  64. self._account_type = value
  65. @property
  66. def bank_code(self):
  67. return self._bank_code
  68. @bank_code.setter
  69. def bank_code(self, value):
  70. self._bank_code = value
  71. @property
  72. def usage_type(self):
  73. return self._usage_type
  74. @usage_type.setter
  75. def usage_type(self, value):
  76. self._usage_type = value
  77. def to_alipay_dict(self):
  78. params = dict()
  79. if self.account_branch_name:
  80. if hasattr(self.account_branch_name, 'to_alipay_dict'):
  81. params['account_branch_name'] = self.account_branch_name.to_alipay_dict()
  82. else:
  83. params['account_branch_name'] = self.account_branch_name
  84. if self.account_holder_name:
  85. if hasattr(self.account_holder_name, 'to_alipay_dict'):
  86. params['account_holder_name'] = self.account_holder_name.to_alipay_dict()
  87. else:
  88. params['account_holder_name'] = self.account_holder_name
  89. if self.account_inst_city:
  90. if hasattr(self.account_inst_city, 'to_alipay_dict'):
  91. params['account_inst_city'] = self.account_inst_city.to_alipay_dict()
  92. else:
  93. params['account_inst_city'] = self.account_inst_city
  94. if self.account_inst_id:
  95. if hasattr(self.account_inst_id, 'to_alipay_dict'):
  96. params['account_inst_id'] = self.account_inst_id.to_alipay_dict()
  97. else:
  98. params['account_inst_id'] = self.account_inst_id
  99. if self.account_inst_name:
  100. if hasattr(self.account_inst_name, 'to_alipay_dict'):
  101. params['account_inst_name'] = self.account_inst_name.to_alipay_dict()
  102. else:
  103. params['account_inst_name'] = self.account_inst_name
  104. if self.account_inst_province:
  105. if hasattr(self.account_inst_province, 'to_alipay_dict'):
  106. params['account_inst_province'] = self.account_inst_province.to_alipay_dict()
  107. else:
  108. params['account_inst_province'] = self.account_inst_province
  109. if self.account_no:
  110. if hasattr(self.account_no, 'to_alipay_dict'):
  111. params['account_no'] = self.account_no.to_alipay_dict()
  112. else:
  113. params['account_no'] = self.account_no
  114. if self.account_type:
  115. if hasattr(self.account_type, 'to_alipay_dict'):
  116. params['account_type'] = self.account_type.to_alipay_dict()
  117. else:
  118. params['account_type'] = self.account_type
  119. if self.bank_code:
  120. if hasattr(self.bank_code, 'to_alipay_dict'):
  121. params['bank_code'] = self.bank_code.to_alipay_dict()
  122. else:
  123. params['bank_code'] = self.bank_code
  124. if self.usage_type:
  125. if hasattr(self.usage_type, 'to_alipay_dict'):
  126. params['usage_type'] = self.usage_type.to_alipay_dict()
  127. else:
  128. params['usage_type'] = self.usage_type
  129. return params
  130. @staticmethod
  131. def from_alipay_dict(d):
  132. if not d:
  133. return None
  134. o = SettleCardInfo()
  135. if 'account_branch_name' in d:
  136. o.account_branch_name = d['account_branch_name']
  137. if 'account_holder_name' in d:
  138. o.account_holder_name = d['account_holder_name']
  139. if 'account_inst_city' in d:
  140. o.account_inst_city = d['account_inst_city']
  141. if 'account_inst_id' in d:
  142. o.account_inst_id = d['account_inst_id']
  143. if 'account_inst_name' in d:
  144. o.account_inst_name = d['account_inst_name']
  145. if 'account_inst_province' in d:
  146. o.account_inst_province = d['account_inst_province']
  147. if 'account_no' in d:
  148. o.account_no = d['account_no']
  149. if 'account_type' in d:
  150. o.account_type = d['account_type']
  151. if 'bank_code' in d:
  152. o.bank_code = d['bank_code']
  153. if 'usage_type' in d:
  154. o.usage_type = d['usage_type']
  155. return o