RepayDetail.py 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class RepayDetail(object):
  6. def __init__(self):
  7. self._capital_amount = None
  8. self._contract_no = None
  9. self._interest_amount = None
  10. self._loan_year = None
  11. self._total_amount = None
  12. @property
  13. def capital_amount(self):
  14. return self._capital_amount
  15. @capital_amount.setter
  16. def capital_amount(self, value):
  17. self._capital_amount = value
  18. @property
  19. def contract_no(self):
  20. return self._contract_no
  21. @contract_no.setter
  22. def contract_no(self, value):
  23. self._contract_no = value
  24. @property
  25. def interest_amount(self):
  26. return self._interest_amount
  27. @interest_amount.setter
  28. def interest_amount(self, value):
  29. self._interest_amount = value
  30. @property
  31. def loan_year(self):
  32. return self._loan_year
  33. @loan_year.setter
  34. def loan_year(self, value):
  35. self._loan_year = value
  36. @property
  37. def total_amount(self):
  38. return self._total_amount
  39. @total_amount.setter
  40. def total_amount(self, value):
  41. self._total_amount = value
  42. def to_alipay_dict(self):
  43. params = dict()
  44. if self.capital_amount:
  45. if hasattr(self.capital_amount, 'to_alipay_dict'):
  46. params['capital_amount'] = self.capital_amount.to_alipay_dict()
  47. else:
  48. params['capital_amount'] = self.capital_amount
  49. if self.contract_no:
  50. if hasattr(self.contract_no, 'to_alipay_dict'):
  51. params['contract_no'] = self.contract_no.to_alipay_dict()
  52. else:
  53. params['contract_no'] = self.contract_no
  54. if self.interest_amount:
  55. if hasattr(self.interest_amount, 'to_alipay_dict'):
  56. params['interest_amount'] = self.interest_amount.to_alipay_dict()
  57. else:
  58. params['interest_amount'] = self.interest_amount
  59. if self.loan_year:
  60. if hasattr(self.loan_year, 'to_alipay_dict'):
  61. params['loan_year'] = self.loan_year.to_alipay_dict()
  62. else:
  63. params['loan_year'] = self.loan_year
  64. if self.total_amount:
  65. if hasattr(self.total_amount, 'to_alipay_dict'):
  66. params['total_amount'] = self.total_amount.to_alipay_dict()
  67. else:
  68. params['total_amount'] = self.total_amount
  69. return params
  70. @staticmethod
  71. def from_alipay_dict(d):
  72. if not d:
  73. return None
  74. o = RepayDetail()
  75. if 'capital_amount' in d:
  76. o.capital_amount = d['capital_amount']
  77. if 'contract_no' in d:
  78. o.contract_no = d['contract_no']
  79. if 'interest_amount' in d:
  80. o.interest_amount = d['interest_amount']
  81. if 'loan_year' in d:
  82. o.loan_year = d['loan_year']
  83. if 'total_amount' in d:
  84. o.total_amount = d['total_amount']
  85. return o