MybankCreditLoantradePartnerPaymentApplyModel.py 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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.PaymentAccountInfo import PaymentAccountInfo
  6. from alipay.aop.api.domain.PaymentAccountInfo import PaymentAccountInfo
  7. class MybankCreditLoantradePartnerPaymentApplyModel(object):
  8. def __init__(self):
  9. self._amount = None
  10. self._biz_product_code = None
  11. self._biz_type = None
  12. self._login_account = None
  13. self._mybk_order_no = None
  14. self._out_order_no = None
  15. self._out_param = None
  16. self._out_seq_no = None
  17. self._payee_account_list = None
  18. self._payer_account_list = None
  19. self._payment_product_code = None
  20. self._user_id = None
  21. @property
  22. def amount(self):
  23. return self._amount
  24. @amount.setter
  25. def amount(self, value):
  26. self._amount = value
  27. @property
  28. def biz_product_code(self):
  29. return self._biz_product_code
  30. @biz_product_code.setter
  31. def biz_product_code(self, value):
  32. self._biz_product_code = value
  33. @property
  34. def biz_type(self):
  35. return self._biz_type
  36. @biz_type.setter
  37. def biz_type(self, value):
  38. self._biz_type = value
  39. @property
  40. def login_account(self):
  41. return self._login_account
  42. @login_account.setter
  43. def login_account(self, value):
  44. self._login_account = value
  45. @property
  46. def mybk_order_no(self):
  47. return self._mybk_order_no
  48. @mybk_order_no.setter
  49. def mybk_order_no(self, value):
  50. self._mybk_order_no = value
  51. @property
  52. def out_order_no(self):
  53. return self._out_order_no
  54. @out_order_no.setter
  55. def out_order_no(self, value):
  56. self._out_order_no = value
  57. @property
  58. def out_param(self):
  59. return self._out_param
  60. @out_param.setter
  61. def out_param(self, value):
  62. self._out_param = value
  63. @property
  64. def out_seq_no(self):
  65. return self._out_seq_no
  66. @out_seq_no.setter
  67. def out_seq_no(self, value):
  68. self._out_seq_no = value
  69. @property
  70. def payee_account_list(self):
  71. return self._payee_account_list
  72. @payee_account_list.setter
  73. def payee_account_list(self, value):
  74. if isinstance(value, list):
  75. self._payee_account_list = list()
  76. for i in value:
  77. if isinstance(i, PaymentAccountInfo):
  78. self._payee_account_list.append(i)
  79. else:
  80. self._payee_account_list.append(PaymentAccountInfo.from_alipay_dict(i))
  81. @property
  82. def payer_account_list(self):
  83. return self._payer_account_list
  84. @payer_account_list.setter
  85. def payer_account_list(self, value):
  86. if isinstance(value, list):
  87. self._payer_account_list = list()
  88. for i in value:
  89. if isinstance(i, PaymentAccountInfo):
  90. self._payer_account_list.append(i)
  91. else:
  92. self._payer_account_list.append(PaymentAccountInfo.from_alipay_dict(i))
  93. @property
  94. def payment_product_code(self):
  95. return self._payment_product_code
  96. @payment_product_code.setter
  97. def payment_product_code(self, value):
  98. self._payment_product_code = value
  99. @property
  100. def user_id(self):
  101. return self._user_id
  102. @user_id.setter
  103. def user_id(self, value):
  104. self._user_id = value
  105. def to_alipay_dict(self):
  106. params = dict()
  107. if self.amount:
  108. if hasattr(self.amount, 'to_alipay_dict'):
  109. params['amount'] = self.amount.to_alipay_dict()
  110. else:
  111. params['amount'] = self.amount
  112. if self.biz_product_code:
  113. if hasattr(self.biz_product_code, 'to_alipay_dict'):
  114. params['biz_product_code'] = self.biz_product_code.to_alipay_dict()
  115. else:
  116. params['biz_product_code'] = self.biz_product_code
  117. if self.biz_type:
  118. if hasattr(self.biz_type, 'to_alipay_dict'):
  119. params['biz_type'] = self.biz_type.to_alipay_dict()
  120. else:
  121. params['biz_type'] = self.biz_type
  122. if self.login_account:
  123. if hasattr(self.login_account, 'to_alipay_dict'):
  124. params['login_account'] = self.login_account.to_alipay_dict()
  125. else:
  126. params['login_account'] = self.login_account
  127. if self.mybk_order_no:
  128. if hasattr(self.mybk_order_no, 'to_alipay_dict'):
  129. params['mybk_order_no'] = self.mybk_order_no.to_alipay_dict()
  130. else:
  131. params['mybk_order_no'] = self.mybk_order_no
  132. if self.out_order_no:
  133. if hasattr(self.out_order_no, 'to_alipay_dict'):
  134. params['out_order_no'] = self.out_order_no.to_alipay_dict()
  135. else:
  136. params['out_order_no'] = self.out_order_no
  137. if self.out_param:
  138. if hasattr(self.out_param, 'to_alipay_dict'):
  139. params['out_param'] = self.out_param.to_alipay_dict()
  140. else:
  141. params['out_param'] = self.out_param
  142. if self.out_seq_no:
  143. if hasattr(self.out_seq_no, 'to_alipay_dict'):
  144. params['out_seq_no'] = self.out_seq_no.to_alipay_dict()
  145. else:
  146. params['out_seq_no'] = self.out_seq_no
  147. if self.payee_account_list:
  148. if isinstance(self.payee_account_list, list):
  149. for i in range(0, len(self.payee_account_list)):
  150. element = self.payee_account_list[i]
  151. if hasattr(element, 'to_alipay_dict'):
  152. self.payee_account_list[i] = element.to_alipay_dict()
  153. if hasattr(self.payee_account_list, 'to_alipay_dict'):
  154. params['payee_account_list'] = self.payee_account_list.to_alipay_dict()
  155. else:
  156. params['payee_account_list'] = self.payee_account_list
  157. if self.payer_account_list:
  158. if isinstance(self.payer_account_list, list):
  159. for i in range(0, len(self.payer_account_list)):
  160. element = self.payer_account_list[i]
  161. if hasattr(element, 'to_alipay_dict'):
  162. self.payer_account_list[i] = element.to_alipay_dict()
  163. if hasattr(self.payer_account_list, 'to_alipay_dict'):
  164. params['payer_account_list'] = self.payer_account_list.to_alipay_dict()
  165. else:
  166. params['payer_account_list'] = self.payer_account_list
  167. if self.payment_product_code:
  168. if hasattr(self.payment_product_code, 'to_alipay_dict'):
  169. params['payment_product_code'] = self.payment_product_code.to_alipay_dict()
  170. else:
  171. params['payment_product_code'] = self.payment_product_code
  172. if self.user_id:
  173. if hasattr(self.user_id, 'to_alipay_dict'):
  174. params['user_id'] = self.user_id.to_alipay_dict()
  175. else:
  176. params['user_id'] = self.user_id
  177. return params
  178. @staticmethod
  179. def from_alipay_dict(d):
  180. if not d:
  181. return None
  182. o = MybankCreditLoantradePartnerPaymentApplyModel()
  183. if 'amount' in d:
  184. o.amount = d['amount']
  185. if 'biz_product_code' in d:
  186. o.biz_product_code = d['biz_product_code']
  187. if 'biz_type' in d:
  188. o.biz_type = d['biz_type']
  189. if 'login_account' in d:
  190. o.login_account = d['login_account']
  191. if 'mybk_order_no' in d:
  192. o.mybk_order_no = d['mybk_order_no']
  193. if 'out_order_no' in d:
  194. o.out_order_no = d['out_order_no']
  195. if 'out_param' in d:
  196. o.out_param = d['out_param']
  197. if 'out_seq_no' in d:
  198. o.out_seq_no = d['out_seq_no']
  199. if 'payee_account_list' in d:
  200. o.payee_account_list = d['payee_account_list']
  201. if 'payer_account_list' in d:
  202. o.payer_account_list = d['payer_account_list']
  203. if 'payment_product_code' in d:
  204. o.payment_product_code = d['payment_product_code']
  205. if 'user_id' in d:
  206. o.user_id = d['user_id']
  207. return o