MybankCreditSceneprodPaymentApplyModel.py 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. from alipay.aop.api.domain.SceneProdPaymentAccountInfo import SceneProdPaymentAccountInfo
  6. from alipay.aop.api.domain.SceneProdPaymentAccountInfo import SceneProdPaymentAccountInfo
  7. class MybankCreditSceneprodPaymentApplyModel(object):
  8. def __init__(self):
  9. self._amount = None
  10. self._biz_product_code = None
  11. self._biz_type = None
  12. self._cust_name = None
  13. self._drawdown_no = None
  14. self._id_card = None
  15. self._login_account = None
  16. self._mybk_order_no = None
  17. self._out_order_no = None
  18. self._out_param = None
  19. self._out_seq_no = None
  20. self._payee_account_list = None
  21. self._payer_account_list = None
  22. self._payment_product_code = None
  23. self._user_id = None
  24. @property
  25. def amount(self):
  26. return self._amount
  27. @amount.setter
  28. def amount(self, value):
  29. self._amount = value
  30. @property
  31. def biz_product_code(self):
  32. return self._biz_product_code
  33. @biz_product_code.setter
  34. def biz_product_code(self, value):
  35. self._biz_product_code = value
  36. @property
  37. def biz_type(self):
  38. return self._biz_type
  39. @biz_type.setter
  40. def biz_type(self, value):
  41. self._biz_type = value
  42. @property
  43. def cust_name(self):
  44. return self._cust_name
  45. @cust_name.setter
  46. def cust_name(self, value):
  47. self._cust_name = value
  48. @property
  49. def drawdown_no(self):
  50. return self._drawdown_no
  51. @drawdown_no.setter
  52. def drawdown_no(self, value):
  53. self._drawdown_no = value
  54. @property
  55. def id_card(self):
  56. return self._id_card
  57. @id_card.setter
  58. def id_card(self, value):
  59. self._id_card = value
  60. @property
  61. def login_account(self):
  62. return self._login_account
  63. @login_account.setter
  64. def login_account(self, value):
  65. self._login_account = value
  66. @property
  67. def mybk_order_no(self):
  68. return self._mybk_order_no
  69. @mybk_order_no.setter
  70. def mybk_order_no(self, value):
  71. self._mybk_order_no = value
  72. @property
  73. def out_order_no(self):
  74. return self._out_order_no
  75. @out_order_no.setter
  76. def out_order_no(self, value):
  77. self._out_order_no = value
  78. @property
  79. def out_param(self):
  80. return self._out_param
  81. @out_param.setter
  82. def out_param(self, value):
  83. self._out_param = value
  84. @property
  85. def out_seq_no(self):
  86. return self._out_seq_no
  87. @out_seq_no.setter
  88. def out_seq_no(self, value):
  89. self._out_seq_no = value
  90. @property
  91. def payee_account_list(self):
  92. return self._payee_account_list
  93. @payee_account_list.setter
  94. def payee_account_list(self, value):
  95. if isinstance(value, list):
  96. self._payee_account_list = list()
  97. for i in value:
  98. if isinstance(i, SceneProdPaymentAccountInfo):
  99. self._payee_account_list.append(i)
  100. else:
  101. self._payee_account_list.append(SceneProdPaymentAccountInfo.from_alipay_dict(i))
  102. @property
  103. def payer_account_list(self):
  104. return self._payer_account_list
  105. @payer_account_list.setter
  106. def payer_account_list(self, value):
  107. if isinstance(value, list):
  108. self._payer_account_list = list()
  109. for i in value:
  110. if isinstance(i, SceneProdPaymentAccountInfo):
  111. self._payer_account_list.append(i)
  112. else:
  113. self._payer_account_list.append(SceneProdPaymentAccountInfo.from_alipay_dict(i))
  114. @property
  115. def payment_product_code(self):
  116. return self._payment_product_code
  117. @payment_product_code.setter
  118. def payment_product_code(self, value):
  119. self._payment_product_code = value
  120. @property
  121. def user_id(self):
  122. return self._user_id
  123. @user_id.setter
  124. def user_id(self, value):
  125. self._user_id = value
  126. def to_alipay_dict(self):
  127. params = dict()
  128. if self.amount:
  129. if hasattr(self.amount, 'to_alipay_dict'):
  130. params['amount'] = self.amount.to_alipay_dict()
  131. else:
  132. params['amount'] = self.amount
  133. if self.biz_product_code:
  134. if hasattr(self.biz_product_code, 'to_alipay_dict'):
  135. params['biz_product_code'] = self.biz_product_code.to_alipay_dict()
  136. else:
  137. params['biz_product_code'] = self.biz_product_code
  138. if self.biz_type:
  139. if hasattr(self.biz_type, 'to_alipay_dict'):
  140. params['biz_type'] = self.biz_type.to_alipay_dict()
  141. else:
  142. params['biz_type'] = self.biz_type
  143. if self.cust_name:
  144. if hasattr(self.cust_name, 'to_alipay_dict'):
  145. params['cust_name'] = self.cust_name.to_alipay_dict()
  146. else:
  147. params['cust_name'] = self.cust_name
  148. if self.drawdown_no:
  149. if hasattr(self.drawdown_no, 'to_alipay_dict'):
  150. params['drawdown_no'] = self.drawdown_no.to_alipay_dict()
  151. else:
  152. params['drawdown_no'] = self.drawdown_no
  153. if self.id_card:
  154. if hasattr(self.id_card, 'to_alipay_dict'):
  155. params['id_card'] = self.id_card.to_alipay_dict()
  156. else:
  157. params['id_card'] = self.id_card
  158. if self.login_account:
  159. if hasattr(self.login_account, 'to_alipay_dict'):
  160. params['login_account'] = self.login_account.to_alipay_dict()
  161. else:
  162. params['login_account'] = self.login_account
  163. if self.mybk_order_no:
  164. if hasattr(self.mybk_order_no, 'to_alipay_dict'):
  165. params['mybk_order_no'] = self.mybk_order_no.to_alipay_dict()
  166. else:
  167. params['mybk_order_no'] = self.mybk_order_no
  168. if self.out_order_no:
  169. if hasattr(self.out_order_no, 'to_alipay_dict'):
  170. params['out_order_no'] = self.out_order_no.to_alipay_dict()
  171. else:
  172. params['out_order_no'] = self.out_order_no
  173. if self.out_param:
  174. if hasattr(self.out_param, 'to_alipay_dict'):
  175. params['out_param'] = self.out_param.to_alipay_dict()
  176. else:
  177. params['out_param'] = self.out_param
  178. if self.out_seq_no:
  179. if hasattr(self.out_seq_no, 'to_alipay_dict'):
  180. params['out_seq_no'] = self.out_seq_no.to_alipay_dict()
  181. else:
  182. params['out_seq_no'] = self.out_seq_no
  183. if self.payee_account_list:
  184. if isinstance(self.payee_account_list, list):
  185. for i in range(0, len(self.payee_account_list)):
  186. element = self.payee_account_list[i]
  187. if hasattr(element, 'to_alipay_dict'):
  188. self.payee_account_list[i] = element.to_alipay_dict()
  189. if hasattr(self.payee_account_list, 'to_alipay_dict'):
  190. params['payee_account_list'] = self.payee_account_list.to_alipay_dict()
  191. else:
  192. params['payee_account_list'] = self.payee_account_list
  193. if self.payer_account_list:
  194. if isinstance(self.payer_account_list, list):
  195. for i in range(0, len(self.payer_account_list)):
  196. element = self.payer_account_list[i]
  197. if hasattr(element, 'to_alipay_dict'):
  198. self.payer_account_list[i] = element.to_alipay_dict()
  199. if hasattr(self.payer_account_list, 'to_alipay_dict'):
  200. params['payer_account_list'] = self.payer_account_list.to_alipay_dict()
  201. else:
  202. params['payer_account_list'] = self.payer_account_list
  203. if self.payment_product_code:
  204. if hasattr(self.payment_product_code, 'to_alipay_dict'):
  205. params['payment_product_code'] = self.payment_product_code.to_alipay_dict()
  206. else:
  207. params['payment_product_code'] = self.payment_product_code
  208. if self.user_id:
  209. if hasattr(self.user_id, 'to_alipay_dict'):
  210. params['user_id'] = self.user_id.to_alipay_dict()
  211. else:
  212. params['user_id'] = self.user_id
  213. return params
  214. @staticmethod
  215. def from_alipay_dict(d):
  216. if not d:
  217. return None
  218. o = MybankCreditSceneprodPaymentApplyModel()
  219. if 'amount' in d:
  220. o.amount = d['amount']
  221. if 'biz_product_code' in d:
  222. o.biz_product_code = d['biz_product_code']
  223. if 'biz_type' in d:
  224. o.biz_type = d['biz_type']
  225. if 'cust_name' in d:
  226. o.cust_name = d['cust_name']
  227. if 'drawdown_no' in d:
  228. o.drawdown_no = d['drawdown_no']
  229. if 'id_card' in d:
  230. o.id_card = d['id_card']
  231. if 'login_account' in d:
  232. o.login_account = d['login_account']
  233. if 'mybk_order_no' in d:
  234. o.mybk_order_no = d['mybk_order_no']
  235. if 'out_order_no' in d:
  236. o.out_order_no = d['out_order_no']
  237. if 'out_param' in d:
  238. o.out_param = d['out_param']
  239. if 'out_seq_no' in d:
  240. o.out_seq_no = d['out_seq_no']
  241. if 'payee_account_list' in d:
  242. o.payee_account_list = d['payee_account_list']
  243. if 'payer_account_list' in d:
  244. o.payer_account_list = d['payer_account_list']
  245. if 'payment_product_code' in d:
  246. o.payment_product_code = d['payment_product_code']
  247. if 'user_id' in d:
  248. o.user_id = d['user_id']
  249. return o